[libvirt-users] getting name or uuid of vm within guest OS
by Behrooz
Hi,
for tl;dr people:
how we can get uuid or name of a vm within a guest os?
description:
We are trying to implement a guest-agent for Archipel* to let us
run simple commands on guest os**. in archipel each vm has its
own jid (jabber id), user will open a chat conversation to vm's
jid and send messages like "!exec ls", then we check that user
(jid) who sent !exec has permission to run commands on our
guest. if he/she had permission we will send a message to jid of
guest-agent with message "ls", guest-agent will run command
then will send result to vm's jid and we tunnel result to user.
now problem is that we don't know (in guest-agent) that what
xmpp server we should connect to and what jid is trusted to
recieve command from. xmpp server is running on hypervisor
and trusted jid is {uuid-of-jvm}(a)hypervisor.com.
right now we've used internal dhcp to set hostname of guest os
to something like "uuid-of-jvm.hypervisor.com" using this switch
(qemu):
-net user,hostname=uuid-of-jvm.hypervisor.com
it works but it's not best solution as it only works with qemu
and we need a solution that works with other virtualization
platforms that libvirt supports.
* https://github.com/ArchipelProject/
** yes, we know about vnc / ssh / ... but by implementing such
thing we can add cool stuff in archipel like status of services
that are running on guest os.
--
regards,
behrooz
12 years, 10 months
[libvirt-users] update virDomainDef with xml config
by xuanmao_001
Libvirt Version: 0.9.8
Hi:
I added a new api for qemu_driver. and both added libvirt.c and remote.
I tested it and it worked well. the function of this new api was add a new field in xml config of domain. (I added it like qemudDomainSetMemoryFlags)at the same time, I added a new member to struct virDomainDef. then I tested xml config converted to virDomaindef and virDomainDef converted to xml config both well(just tested this new api). But there was a problem, if I change the memory size or cpu number then apply it with virtManager. the xml config was changed. but there is no field in the xml what I added. I guest the virDomainDef member in virDomainObjPtr wasn't update.
I have no idea, can you give me some ideas? thanks!
here is my code in qemu_driver.c:
static int qemudDomainSetCustomOptions(virDomainPtr dom, char *opt)
{
struct qemud_driver *driver = dom->conn->privateData;
virDomainObjPtr vm;
virDomainDefPtr persistentDef = NULL;
int ret = -1;
qemuDriverLock(driver);
vm = virDomainFindByUUID(&driver->domains, dom->uuid);
qemuDriverUnlock(driver);
if (!vm) {
char uuidstr[VIR_UUID_STRING_BUFLEN];
virUUIDFormat(dom->uuid, uuidstr);
qemuReportError(VIR_ERR_NO_DOMAIN,
_("no domain with matching uuid '%s'"), uuidstr);
goto cleanup;
}
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
goto cleanup;
if (!vm->persistent) {
qemuReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("cannot change persistent config of a transient domain"));
goto endjob;
}
if (!(persistentDef = virDomainObjGetPersistentDef(driver->caps, vm)))
goto endjob;
sa_assert(persistentDef);
persistentDef->running_mode = opt;
ret = virDomainSaveConfig(driver->configDir, persistentDef);
ret = 0;
endjob:
if (qemuDomainObjEndJob(driver, vm) == 0)
vm = NULL;
cleanup:
if (vm)
virDomainObjUnlock(vm);
return ret;
}
xuanmao_001
12 years, 10 months
[libvirt-users] caps->nguests == 0?
by Zhihua Che
hi,
I compiled the libvirt-0.9.10 and started the libvirtd with sudo.
Unfortunately, I got an Error, saying 'virDomainDefParseXML unknown OS
type hvm'. I debugged it and found in function
virCapabilitiesSupportsGuestOSType, the parameter caps->nguests is 0.
On the other hand, I tried start the libvirtd with common user, and
creating domain with virsh, i found the caps->ngusts is 2 and had one
value 'hvm', so it didn't complain the error above, instead, it
complained could not load PC BIOS bios.bin.
I'd say I searched a lot and people say it's caused by without loading
kvm and kvm-intel module. So, I checked and it is loaded. Any tips
here?
12 years, 10 months
[libvirt-users] unsupported configuration: Reboot is not supported with this QEMU binary
by Xing.x.Gao
Hello,
when i use virsh to reboot a guest,it report a "unsupported
configuration: Reboot is not supported with this QEMU binary" error .
my libvirt version 0.9.10 and i've tried 0.9.11/12 ,the debug info is
in the attachment libvirtd.log,
virsh # version --daemon
Compiled against library: libvir 0.9.10
Using library: libvir 0.9.10
Using API: QEMU 0.9.10
Running hypervisor: QEMU 0.14.0
Running against daemon: 0.9.10
virsh # list
Id Name State
----------------------------------------------------
6 win7 running
7 f16 running
virsh # reboot f16
error: Failed to reboot domain f16
error: unsupported configuration: Reboot is not supported with this QEMU binary
thanks.
12 years, 10 months
[libvirt-users] How to update the QEMU of libvirt?
by GaoYi
Hi all,
I type "version" and the virsh outputs:
Compiling library: libvir 0.6.3
...
Management: QEMU 0.9.1
Now I wanna update the QEMU to qemu-kvm-0.14.0. I don't know how to. Can
anybody provide any help?
Yi
12 years, 10 months
Re: [libvirt-users] [Qemu-devel] How to management KVM virtual machines via libvirt?
by 陳韋任 (Wei-Ren Chen)
CC'ed to libvirt-users.
On Sat, Jun 16, 2012 at 07:00:59PM +0800, GaoYi wrote:
> Hi all,
>
> I am trying to management the VMs created by KVM commandline. However, I
> found the libvirt cannot connect to the VMs or manage it from virsh. Can
> anybody provide any help?
> Best,
Shouldn't this go to libvirt mailing list?
http://libvirt.org/contact.html
Regards,
chenwj
--
Wei-Ren Chen (陳韋任)
Computer Systems Lab, Institute of Information Science,
Academia Sinica, Taiwan (R.O.C.)
Tel:886-2-2788-3799 #1667
Homepage: http://people.cs.nctu.edu.tw/~chenwj
12 years, 10 months
[libvirt-users] question regarding CMPIObjectPath
by Ashish Dalela
Folks,
I'm a new user and I'm trying to build a standalone application using
libvirt-cim (rather than use a full-fledged CIMOM). I need some help.
While calling the CMPIInstanceMI->ft->enumerateInstances, I need to pass a
reference to CMPIObjectPath. My application is crashing because I don't
know what is the correct constructor for this. If I do ref = CMPIObjectPath
() then all the FT pointers are null.
Can someone please guide me on how to construct CMPIObjectPath instance
before passing to enumerateInstances?
Thanks much
Ashish
12 years, 11 months
[libvirt-users] can not connect hypervisor using libvirt-0.9.11 on windows
by xuteng
Hi,ALL:
I compiled the libvirt-0.9.11 source code with mingw on windows according to the website:
https://github.com/photron/msys_setup
Then I wrote a simple test case ,as below:
#include <stdio.h>
#include <stdlib.h>
#include "libvirt/libvirt.h"
int main(int argc,char **argv)
{
virConnectPtr conn;
conn = virConnectOpen("qemu+tcp://192.168.1.6/system");
if (conn = NULL)
{
fprintf(stderr,"Failed to open connection to qemu+tcp://192.168.1.6/system");
return 1;
}
virConnectClose(conn);
return 0;
}
When linked to the dll just compiled , it came out with error :
NOTE: you should run 'diskperf -y' to enable the disk statistics
libvir: RPC error : Unable to set close-on-exec flag: No such file or directory
libvir: error : invalid connection pointer in virConnectClose
When using gdb to debug the testcase , break the function virConnectOpen , then step ,the error info was:
Program received signal ?,Unknown signal.
0x7c92e4ff in ntdll!LdrAlternateResourcesEnabled ()
from C:\WINDOWS.0\system32\ntdll.dll
Any suggestion would be appreciated !
Best Regards!
xuteng via foxmail
12 years, 11 months