Re: [libvirt] How to start a defined domain
by 黄亮
Well, after "make clean", I run the compiled start.c, still won't work.
And I forget to metion, an error msg is shown:
libvir: Xen error : Domain not found: xenUnifiedDomainLookupByName
is that means I missed something?
2010-10-26
黄亮
发件人: Osier
发送时间: 2010-10-26 18:05:46
收件人: 黄亮
抄送:
主题: Re: [libvirt] How to start a defined domain
----- "黄亮" <lancerhuang(a)163.com> wrote:
>
> Accroding to your case, it seems I have no need to upgrade libvirt to
> 0.8.4
> Will that work if I erase 0.8.4 using "make clean" and draw back to
> 0.6.3 ?
yep, think so, if you don't need the new features, and 0.6.3 is enough
for your project requirement.. :-)
- Osier
>
>
>
> 2010-10-26
>
> 黄亮
>
> 发件人: Osier
> 发送时间: 2010-10-26 17:10:40
> 收件人: 黄亮
> 抄送:
> 主题: Re: [libvirt] How to start a defined domain
>
>
>
> ----- "黄亮" <lancerhuang(a)163.com> wrote:
>
> >
> > Thanks for your reply, Osier.
> >
> >
> > The distro I'm using is CentOS release 5.5 (Final)
> >
> > I'm not quite sure about the version of libvirt. At first, it seems
> to
> > be 0.6.3, because /usr/lib64/libvirt.so.0 points to
> > /usr/lib64/libvirt.so.0.6.3
> > Then I downloaded the src of libvirt_0.8.4 from offical website, and
> > configure, make, make install.
> > But now it show errors when I type "virsh". The error message lies
> > below:
> >
> > virsh: /usr/local/lib/libvirt.so.0: version `LIBVIRT_0.8.2' not
> found
> > (required by virsh)
> > virsh: /usr/local/lib/libvirt.so.0: version `LIBVIRT_0.7.1' not
> found
> > (required by virsh)
> > virsh: /usr/local/lib/libvirt.so.0: version `LIBVIRT_0.7.5' not
> found
> > (required by virsh)
> > virsh: /usr/local/lib/libvirt.so.0: version `LIBVIRT_0.8.1' not
> found
> > (required by virsh)
> > virsh: /usr/local/lib/libvirt.so.0: version `LIBVIRT_0.7.0' not
> found
> > (required by virsh)
> > virsh: /usr/local/lib/libvirt.so.0: version `LIBVIRT_0.7.2' not
> found
> > (required by virsh)
> > virsh: /usr/local/lib/libvirt.so.0: version `LIBVIRT_0.7.3' not
> found
> > (required by virsh)
> > virsh: /usr/local/lib/libvirt.so.0: version `LIBVIRT_0.8.0' not
> found
> > (required by virsh)
> > virsh: /usr/local/lib/libvirt.so.0: version `LIBVIRT_PRIVATE_0.8.4'
> > not found (required by virsh)
> > virsh: /usr/local/lib/libvirt.so.0: version `LIBVIRT_0.7.7' not
> found
> > (required by virsh)
> > virsh: /usr/local/lib/libvirt.so.0: version `LIBVIRT_0.6.4' not
> found
> > (required by virsh)
>
> probly you should try to erase the 0.6.3, then compile and install
> libvirt
> like:
>
> # ./configure --prefix=/usr --libdir=/usr/lib64
> # make
> # make install
>
> your test program has no problem on my box. the libvirt on my box also
> is
> 0.6.3.
>
> Regards
>
> - Osier
> >
> > As for xen, it is 3.3.2. The full "xm info" message is listed below:
> > host : testbed01
> > release : 2.6.18-194.11.4.el5xen
> > version : #1 SMP Tue Sep 21 05:40:24 EDT 2010
> > machine : x86_64
> > nr_cpus : 8
> > nr_nodes : 1
> > cores_per_socket : 4
> > threads_per_core : 2
> > cpu_mhz : 2793
> > hw_caps :
> >
> bfebfbff:28100800:00000000:00000140:0098e3fd:00000000:00000001:00000000
> > virt_caps : hvm
> > total_memory : 4055
> > free_memory : 533
> > node_to_cpu : node0:0-7
> > node_to_memory : node0:533
> > xen_major : 3
> > xen_minor : 3
> > xen_extra : .2
> > xen_caps : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32
> > hvm-3.0-x86_32p hvm-3.0-x86_64
> > xen_scheduler : credit
> > xen_pagesize : 4096
> > platform_params : virt_start=0xffff800000000000
> > xen_changeset : unavailable
> > cc_compiler : gcc version 4.1.2 20080704 (Red Hat 4.1.2-44)
> > cc_compile_by : root
> > cc_compile_domain : gitco.tld
> > cc_compile_date : Tue Aug 18 21:07:28 CEST 2009
> > xend_config_format : 4
> >
> > I've write a simple c program to test the api, and it is listed
> below:
> >
> > 1 // This program aims to test the api which can start the VM
> > 2
> > 3 #include "stdio.h"
> > 4 #include "stdlib.h"
> > 5 #include "libvirt/libvirt.h"
> > 6
> > 7 int main(int argc ,char* argv[])
> > 8 {
> > 9 virConnectPtr conn;
> > 10 conn = virConnectOpen( "xen+tcp://localhost?no_Verify=1" );
> > 11 if( conn == NULL )
> > 12 {
> > 13 printf( "Failed to Connect\n" );
> > 14 return 1;
> > 15 }
> > 16 const char* host = "vm01";
> > 17 virDomainPtr dom;
> > 18 dom = virDomainLookupByName( conn, host );
> > 19 if( dom == NULL )
> > 20 {
> > 21 printf( "can't find dom\n" );
> > 22 return 1;
> > 23 }
> > 24 // else
> > 25 // {
> > 26 // virDomainFree( dom );
> > 27 // virConnectClose( conn );
> > 28 // printf("done\n");
> > 29 // return 0;
> > 30 // }
> > 31 if( virDomainCreate( dom ) == -1 )
> > 32 {
> > 33 printf( "failed to Start\n" );
> > 34 virDomainFree( dom );
> > 35 virConnectClose( conn );
> > 36 return 1;
> > 37 }
> > 38 else
> > 39 {
> > 40 printf( "Started\n" );
> > 41 virDomainFree( dom );
> > 42 virConnectClose( conn );
> > 43 return 0;
> > 44 }
> > 45 }
> >
> > 2010-10-26
> >
> > Lancer
> >
> > 发件人: Osier
> > 发送时间: 2010-10-26 11:35:31
> > 收件人: 黄亮
> > 抄送: libvir-list
> > 主题: Re: [libvirt] How to start a defined domain
> >
> >
> >
> > ----- "黄亮" <lancerhuang(a)163.com> wrote:
> >
> > > I've create a domain called "vm01" using Virt-Manager, the GUI
> tool.
> > > Now I wanna use libvirt api to control the life cycle of vm01.
> > > It went on well with shutdown and reboot, but how to start it
> became
> > a
> > > problem.
> > >
> > > I was intended to get the virDomainPtr by using
> > virDomainLookupByName
> > > api, and then start it using virDomainCreate api.
> > > But it turns out that virDomainLookupByName api cannot return a
> > > virDomainPtr for a defined but not running domain.
> > >
> >
> > no, it can :-)
> >
> > If it really doesn't work for you, could you write a simple program
> to
> > reproduce it? and try to explain what's the version of libvirt you
> > use,
> > on which distro, etc, any helpful info is welcomed. :-)
> >
> > Thanks
> >
> > - Osier
> >
> > > That's my situation, what do you suggest I do now?
> > > Thanks in advance.
> > >
> > > 2010-10-26
> > >
> > > Lancer
> > > --
> > > libvir-list mailing list
> > > libvir-list(a)redhat.com
> > > https://www.redhat.com/mailman/listinfo/libvir-list
> >
> > __________ Information from ESET Smart Security, version of virus
> > signature database 5562 (20101025) __________
> >
> > The message was checked by ESET Smart Security.
> >
> > http://www.eset.com
>
> __________ Information from ESET Smart Security, version of virus
> signature database 5562 (20101025) __________
>
> The message was checked by ESET Smart Security.
>
> http://www.eset.com
__________ Information from ESET Smart Security, version of virus signature database 5563 (20101026) __________
The message was checked by ESET Smart Security.
http://www.eset.com
14 years, 1 month
[libvirt] RFC: Libvirt extensions for QEMU tracing
by Prerna Saxena
Hi,
Tracing infrastructure is now a part of upstream QEMU, which allows
options to choose different trace backends to handle trace-events of
interest. The choice of 'simple' trace backend allows users to
dynamically enable/disable trace events for a running qemu instance as
well as to set options for logging traces to a desired file via the qemu
monitor.
While the QMP interfaces are still under discussion
(http://www.mail-archive.com/qemu-devel@nongnu.org/msg44535.html), I
propose the following extensions for virsh to make use of human-monitor
tracing commands:
1. virsh trace-events DOMAIN-ID [set TRACE-EVENT ON ]
----------------------------------------------------
- Implements QEMU monitor command 'trace event' to change state of a
particular trace-event.
- Eg, virsh trace-events DOMAIN-ID set ABC on
: changes state of trace-event 'ABC' to enabled.
- When specified without arguments, it implements QEMU monitor command
to show all currently available trace events and their state for a
specific instance.
- Eg, virsh trace-events DOMAIN-ID
: lists all trace-events with their state for that instance.
2. virsh trace-file DOMAIN_ID [set FILENAME | --enable | --disable]
-------------------------------------------------------------------
- Implements the qemu monitor command : trace-file
- Without any arguments, it lists the currently active trace output
file with its state.
- The 'set' subcommand changes the output file to FILENAME.
- The --enable and --disable switches respectively enable and disable
writing of trace data to output file.
The catch is, these are only available for 'simple' trace backend for
qemu, so one would need to be careful of handling failures when these
commands are passed to qemu instances compiled with a different trace
backend.
It would have been much easier if there existed a generic virsh command
to pass commands to the QEMU monitor. I saw some patches for
qemu-monitor-command option for
virsh,(http://www.mail-archive.com/libvir-list@redhat.com/msg26237.html)
but looks like it is not upstream right now.
In order to support QEMU tracing, would this be a better bet than
implementing virsh extensions listed above ?
If yes, any chance we might have it in for the next release ?
Awaiting feedback,
--
Prerna Saxena
Linux Technology Centre,
IBM Systems and Technology Lab,
Bangalore, India
14 years, 1 month
[libvirt] List of available libvirt drivers installed?
by Shi Jin
I am wondering if there is a way to show a list of available libvirt hypervisor drvers installed in an existing libvirt installation.
I know based on the version of libvirt, I can find out supported drivers from this matrix: http://libvirt.org/hvsupport.html
However, the particular installation may not turn on all available drivers for this particular build. Is there a way to find out?
Particularly, I want to find out if the default libvirt coming with RHEL-5/6 supports VMware ESX, and the same for Ubuntu-10.4/10.10.
Thanks in advance.
Shi
--
Shi Jin, PhD
14 years, 1 month
[libvirt] [PATCH 1/2] virsh: Add option 'model' for attach-interface
by Osier Yang
Allows to specify the NIC model type when attaching an interface,
it's an optional option.
---
tools/virsh.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c
index 3e37b06..2da9489 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -8292,6 +8292,7 @@ static const vshCmdOptDef opts_attach_interface[] = {
{"target", VSH_OT_DATA, 0, N_("target network name")},
{"mac", VSH_OT_DATA, 0, N_("MAC address")},
{"script", VSH_OT_DATA, 0, N_("script used to bridge network interface")},
+ {"model", VSH_OT_DATA, 0, N_("model type")},
{"persistent", VSH_OT_BOOL, 0, N_("persist interface attachment")},
{NULL, 0, 0, NULL}
};
@@ -8300,7 +8301,7 @@ static int
cmdAttachInterface(vshControl *ctl, const vshCmd *cmd)
{
virDomainPtr dom = NULL;
- char *mac, *target, *script, *type, *source;
+ char *mac, *target, *script, *type, *source, *model;
int typ, ret = FALSE;
unsigned int flags;
virBuffer buf = VIR_BUFFER_INITIALIZER;
@@ -8319,6 +8320,7 @@ cmdAttachInterface(vshControl *ctl, const vshCmd *cmd)
target = vshCommandOptString(cmd, "target", NULL);
mac = vshCommandOptString(cmd, "mac", NULL);
script = vshCommandOptString(cmd, "script", NULL);
+ model = vshCommandOptString(cmd, "model", NULL);
/* check interface type */
if (STREQ(type, "network")) {
@@ -8345,6 +8347,8 @@ cmdAttachInterface(vshControl *ctl, const vshCmd *cmd)
virBufferVSprintf(&buf, " <mac address='%s'/>\n", mac);
if (script != NULL)
virBufferVSprintf(&buf, " <script path='%s'/>\n", script);
+ if (model != NULL)
+ virBufferVSprintf(&buf, " <model type='%s'/>\n", model);
virBufferAddLit(&buf, "</interface>\n");
--
1.7.1
14 years, 1 month
[libvirt] --checksum-fill error on Ubuntu 10.04
by Justin Clift
Hi us,
Just noticed an error message when manually starting libvirtd (built
from git) on Ubuntu 10.04, while checking something else:
iptables v1.4.4: unknown option `--checksum-fill'
It shows up in the initial default network setup:
10:40:19.807: error : virRunWithHook:855 : internal error
'/sbin/iptables --table mangle --insert POSTROUTING --out-interface
virbr0 --protocol udp --destination-port 68 --jump CHECKSUM
--checksum-fill' exited with non-zero status 2 and signal 0: iptables
v1.4.4: unknown option `--checksum-fill'
Try `iptables -h' or 'iptables --help' for more information.
Just a FYI, in case someone wants to look into it.
Regards and best wishes,
Justin Clift
14 years, 1 month
Re: [libvirt] How to start a defined domain
by Osier
----- "黄亮" <lancerhuang(a)163.com> wrote:
> I've create a domain called "vm01" using Virt-Manager, the GUI tool.
> Now I wanna use libvirt api to control the life cycle of vm01.
> It went on well with shutdown and reboot, but how to start it became a
> problem.
>
> I was intended to get the virDomainPtr by using virDomainLookupByName
> api, and then start it using virDomainCreate api.
> But it turns out that virDomainLookupByName api cannot return a
> virDomainPtr for a defined but not running domain.
>
no, it can :-)
If it really doesn't work for you, could you write a simple program to
reproduce it? and try to explain what's the version of libvirt you use,
on which distro, etc, any helpful info is welcomed. :-)
Thanks
- Osier
> That's my situation, what do you suggest I do now?
> Thanks in advance.
>
> 2010-10-26
>
> Lancer
> --
> libvir-list mailing list
> libvir-list(a)redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list
14 years, 1 month
[libvirt] How to start a defined domain
by 黄亮
I've create a domain called "vm01" using Virt-Manager, the GUI tool.
Now I wanna use libvirt api to control the life cycle of vm01.
It went on well with shutdown and reboot, but how to start it became a problem.
I was intended to get the virDomainPtr by using virDomainLookupByName api, and then start it using virDomainCreate api.
But it turns out that virDomainLookupByName api cannot return a virDomainPtr for a defined but not running domain.
That's my situation, what do you suggest I do now?
Thanks in advance.
2010-10-26
Lancer
14 years, 1 month
[libvirt] Initial working Mac OS X libvirt client build
by Justin Clift
Hi all,
This is for anyone using the Homebrew package management system on Mac
OS X. :)
A first working (but still experimental) libvirt formula is online:
http://github.com/justinclift/libvirt
It includes the libvirt text mode client (virsh), and the libvirt
development libraries.
If you have time to test it and report success/failure/(etc), please do.
Be aware, for the moment, it pulls down a tarred up snapshot of libvirt
git, with a few trivial patches applied to make compiling work:
What works:
+ Remote connections using TLS (qemu+tls://) <-- encrypted
+ Remote connections using TCP (qemu+tls://) <-- not encrypted!
What doesn't work:
+ Remote connections using SSH (qemu+ssh://), if the server has
PolicyKit enabled. (possible bug, will look into it)
In theory, this means connecting to Ubuntu server should work,
as that uses groups to control access rather than PolicyKit.
Haven't tried it though, so if you do, please let me know how
it goes. ;)
Testing and feedback is encouraged. The aim here is to have the libvirt
client (virsh) plus development libraries work properly on OS X.
Please note, I'm new to OS X, github, and Homebrew, so if you notice
things that should be done better/differently/etc, please let me know. :)
Regards and best wishes,
Justin Clift
14 years, 1 month