[ovirt-devel] Select storage domain when creating VM from template with python-SDK

Philip Strömbäck philipstromback at gmail.com
Tue Jun 9 15:41:56 UTC 2015


Hi,

I have a question about python-SDK for Ovirt Engine API. When creating a
new VM from a template in Clone/Independent-mode, I'm not unable to select
storage domain for the new disk. It seems like it always get created on the
same disk at the template. I can move the disk after creation but it's a
little bit time consuming.

Example:

vm_params = params.VM ( name = vm_name, cluster = api.clusters.get (
"Cluster-1" ), template = api.templates.get ( "RHEL7" ), storage_domain =
api.storagedomains.get ( "iscsi1" ), disks = params.Disks ( clone = True ) )

try:
       api.vms.add ( vm_params )
except Exception, e:
       raise SystemExit ( "Could not create VM from template: %s" % (  e ) )

The VM is added correctly but the disk is located on iscsi0 ( the same as
the template ).

Have anybody an idea how to get this sorted out?

Best regards,
Philip
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ovirt.org/pipermail/devel/attachments/20150609/65fc03c9/attachment-0001.html>


More information about the Devel mailing list