[libvirt-users] access VMX config on esxi with virsh

Hi, Is virsh able to access the VMX config of a virtual machine running on a esxi host? I would like to take backups of my virtual machine configs and the doku section "Converting from VMware VMX config to domain XML config" (http://libvirt.org/drvesx.html) comes close to this - but does not tell how to get access to the vmx file. I would prefer a solution where ssh access to the esxi host can stay disabled. best regards, frank -- Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief! Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail

2010/9/17 frank dirks <frankdirks@gmx.net>:
Hi,
Is virsh able to access the VMX config of a virtual machine running on a esxi host?
I would like to take backups of my virtual machine configs and the doku section "Converting from VMware VMX config to domain XML config" (http://libvirt.org/drvesx.html) comes close to this - but does not tell how to get access to the vmx file. I would prefer a solution where ssh access to the esxi host can stay disabled.
best regards, frank
virsh (and libvirt) don't expose the .vmx files, so there is no way to access them directly trough libvirt. You could get the domain XML config and convert it to .vmx format using domxml-to-native, but that doesn't give you the original .vmx file. The .vmx files are stored in the datastore attached to the ESX(i) server. You don't need SSH to access the datastore content, An example, you can access the .vmx file of the virtual machine <vm> on <esxi-server> stored in <datastore> using this URL: https://<esxi-server>/folder/<vm>/<vm>.vmx?dcPath=ha-datacenter&dsName=<datastore> You can also open https://<esxi-server>/folder/ in your web browser and navigate through the content. Matthias

Hi Mathias, thank you very much - which part of the doku did i miss so i didn't know about the web-access to the vmx files?
virsh (and libvirt) don't expose the .vmx files, so there is no way to access them directly trough libvirt. You could get the domain XML config and convert it to .vmx format using domxml-to-native, but that doesn't give you the original .vmx file.
which command gives me the domain xml? dumpxml gives me an error message (expecting an assignment) - the other xml command need the vmx file i guess ... btw: do you think libvirt is an option for backup tasks around esxi virtual machines? or do you know another suitable tool? regards, frank -- GRATIS: Spider-Man 1-3 sowie 300 weitere Videos! Jetzt freischalten! http://portal.gmx.net/de/go/maxdome

On 09/20/2010 06:00 PM, frank dirks wrote:
Hi Mathias, <snip> which command gives me the domain xml? dumpxml gives me an error message (expecting an assignment) - the other xml command need the vmx file i guess ...
Hi Frank, "In theory" the dumpxml should do that. ie.: # virsh dumpxml F11test <domain type='kvm'> <name>F11test</name> <uuid>cb3878e2-a1fc-c035-e57c-087e11abcbfe</uuid> <memory>1048576</memory> <currentMemory>1048576</currentMemory> <vcpu>2</vcpu> <os> <type arch='x86_64' machine='rhel6.0.0'>hvm</type> <boot dev='hd'/> </os> (...) <memballoon model='virtio'> <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> </memballoon> </devices> </domain> However, it sounds like that's not working for you. That could be a bug. Would you be ok with trying it again, then pasting the error message here for us to see? Regards and best wishes, Justin Clift
participants (3)
-
frank dirks
-
Justin Clift
-
Matthias Bolte