Hi, I've been trying to figure out how to create a new domain(create a new virtual machine) using the ESX driver. The documentation at http://libvirt.org/drvesx.html says: To define a new domain the driver converts the domain XML into a VMware VMX file and uploads it to a datastore known to the ESX server. Because multiple datastores may be known to an ESX server the driver needs to decide to which datastores the VMX file should be uploaded. The driver deduces this information from the path of the source of the first file-based harddisk listed in the domain XML. But I can't find a way to do this in virsh. Any ideas? -George -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20100716/7b958a00/attachment.htm>
2010/7/16 George Goh <georgegoh at spodon.com>:> Hi, > I've been trying to figure out how to create a new domain(create a new > virtual machine) using the ESX driver. > The documentation at?http://libvirt.org/drvesx.html says: > To define a new domain the driver converts the domain XML into a VMware VMX > file and uploads it to a datastore known to the ESX server. Because multiple > datastores may be known to an ESX server the driver needs to decide to which > datastores the VMX file should be uploaded. The driver deduces this > information from the path of the source of the first file-based harddisk > listed in the domain XML. > But I can't find a way to do this in virsh. Any ideas? > -GeorgeYou quoted a paragraph that describes what the driver does internally while defining a new domain. This paragraph is there because the way it works internally has implications on how you have to specify disk devices in the domain XML. It has nothing to do with the way you define a new domain in general. Defining a new domain using virsh works as with any other backend supported by libvirt. 1) Create a domain XML config file test1.xml containing this example config (assuming the default local datastore named 'Storage1' and the default virtual port group named 'VM Network'): <domain type='vmware'> <name>test1</name> <memory>524288</memory> <currentMemory>524288</currentMemory> <vcpu>1</vcpu> <os> <type arch='i686'>hvm</type> </os> <devices> <disk type='file' device='disk'> <source file='[Storage1] test1/test1.vmdk'/> <target dev='sda' bus='scsi'/> <address type='drive' controller='0' bus='0' unit='0'/> </disk> <disk type='file' device='cdrom'> <source file='[Storage1] iso/Fedora-13-i686-Live.iso'/> <target dev='hda' bus='ide'/> <address type='drive' controller='0' bus='0' unit='0'/> </disk> <controller type='scsi' index='0'/> <controller type='ide' index='0'/> <interface type='bridge'> <source bridge='VM Network'/> </interface> </devices> </domain> 2) Start virsh: virsh -c esx://example-esx-server.com/?no_verify=1 3) At the virsh prompt execute a define command: define /path/to/test1.xml Currently this requires that you manually created the .vmdk file '[Storage1] test1/test1.vmdk' before. I'm currently working on the libvirt storage management for ESX. I expect that libvirt 0.8.3 will be able to create new .vmdk files in an ESX datastore. Matthias