2010/12/2 mop amg <amghostman(a)gmail.com>:
Hi, Dear.
I have two questions ask for help:
my virt-manager and libvirt version is :
linux-vaan:~ # rpm -q libvirt
libvirt-0.8.5-1.2.i586
linux-vaan:~ # uname -a
Linux linux-vaan 2.6.34-12-desktop #1 SMP PREEMPT 2010-06-29 02:39:08 +0200
i686 i386 GNU/Linux
linux-vaan:~ # rpm -q virt-manager
virt-manager-0.8.5-3.1.i586
linux-vaan:~ # cat /etc/SuSE-release
openSUSE 11.3 (i586)
VERSION = 11.3
virsh # version
Compiled against library: libvir 0.8.5
Using library: libvir 0.8.5
Using API: ESX 0.8.5
Running hypervisor: ESX 4.1.0
question 1 :
When I try to create a vmware esxi domain from virsh like this :
create --file /work/dom1.x
there is a error message :
error: Failed to create domain from /work/dom1.xml
error: this function is not supported by the connection driver:
virDomainCreateXML
it seems dosen't support create esxi domain, but the
http://libvirt.org/hvsupport.html show that is supported after ≥ 0.7.0
virDomainCreateXML and virDomainCreate are different.
virDomainCreateXML creates a new transient domain and starts it,
virDomainCreate starts a persistent domain that has been created using
virDomainDefineXML before.
A transient domain will automatically go away when it is stopped. A
persistent domain won't and has a persistent config stored to disk.
ESX(i) doesn't have this transient semantic for it's domains,
therefore libvirt can't support virDomainCreateXML for it.
In order to create a new ESX(i) domain you need to define it using
virDomainDefineXML. In virsh use 'define /work/dom1.x' instead of
'create --file /work/dom1.x' to create a new domain, then use 'start
dom1' to start it.
or create via virt-install
linux-vaan:~ # virt-install
--connect=esx://root@192.168.8.162/?no_verify=1 -n rhel5 -r 512 --vcpus=1
--nodisks bridge=vmk0 --network bridge=vmk0 --pxe
Enter root's password for 192.168.8.162:
Starting install...
ERROR this function is not supported by the connection driver:
virDomainCreateXML
how to fix it ?
Unfortunately virt-install doesn't work for ESX(i) yet. One reason is
that it uses virDomainCreateXML, but there are some other things that
need to be implemented or solved before virt-install will be able to
install an ESX(i) guest.
dom1.xml
<domain type='vmware'>
<name>dom1</name>
<memory>524288</memory>
<currentMemory>524288</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch='i686'>hvm</type>
</os>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<disk type='file' device='disk'>
<source file='[datastore1] rhel5/rhel5_2.vmdk'/>
<target dev='sda' bus='scsi'/>
<address type='drive' controller='0' bus='0'
unit='0'/>
</disk>
<controller type='scsi' index='0' model='lsilogic'/>
<interface type='bridge'>
<mac address='00:0c:29:51:f1:1c'/>
<source bridge='VM Network'/>
</interface>
</devices>
</domain>
This domain config looks good and should work assuming '[datastore1]
rhel5/rhel5_2.vmdk' exists. You can use virsh vol-create to create it
if it doesn't.
question 2:
vol-clone failed
virsh # vol-clone --pool datastore1 rhel5/rhel5.vmdk rhel5/rhel5_2.vmdk
error: Failed to clone vol from rhel5/rhel5.vmdk
error: this function is not supported by the connection driver:
virStorageVolCreateXMLFrom
virStorageVolCreateXMLFrom wasn't implemented for ESX(i) until now :)
I just implemented it and it'll probably be part of libvirt 0.8.7.
Matthias