i want define new persistent domain using libvirt java bindings on esxi host. created xml description it, in set (among other things) devices vm , source files. however, unless manually create source file device on server, exists when defining vm programatically, fail. here xml code use:
<disk type='file' device='disk'> <source file='[datastore1] testvm/testvm.vmdk'/> <target dev='sda' bus='scsi'/> <address type='drive' controller='0' bus='0' unit='0'/> </disk>
so testvm.vmdk
needs exist before making call define domain, need somehow create programmatically. have idea how using libvirt java bindings?
ok, found solution, in case else looking this. libvirt provides java api create storage volume in storage pool, based on xml description. need specify path vmdk file in description, , use path when creating new vm. storage pool via storagepoollookupbyname
method in connect object , add volume pool via storagevolcreatexml
.
Comments
Post a Comment