That option has to be passed when you start the VM, not in the creation
phase:

api.vms.get(NEW_VM_NAME).start(use_sysprep=true)



Il 29/08/2019 12:45, Harry Conings ha scritto:
> Hi
> i am trying to create virtual machines from a template but i cannot seem to 
> find how to ad the inital run sysprep option
> how should i give that option ?
> my code
> <code>
>  NEW_VM_NAME = 'W10MYMACINE'
>     TEMPLATE_NAME = 'W10TEMP'
>     CLUSTER_NAME= 'MYCLUSTER'
> 
>     try:
>         api.vms.add(params.VM(name=NEW_VM_NAME, 
> cluster=api.clusters.get(CLUSTER_NAME),
>                               template=api.templates.get(TEMPLATE_NAME)))
>         print 'VM was created from Template successfully'
>         print 'Waiting for VM to reach Down status'
>         while api.vms.get(NEW_VM_NAME).status.state != 'down':
>             sleep(1)
>     except Exception as e:
>         print 'Failed to create VM from Template:\n%s' % str(e)
> </code>
> _______________________________________________
> Users mailing list -- users@ovirt.org
> To unsubscribe send an email to users-le...@ovirt.org
> Privacy Statement: https://www.ovirt.org/site/privacy-policy/
> oVirt Code of Conduct: 
> https://www.ovirt.org/community/about/community-guidelines/
> List Archives: 
> https://lists.ovirt.org/archives/list/users@ovirt.org/message/CIWFZXRJTELNSMH34A5XBQQFFZETZXIA/
> 
_______________________________________________
Users mailing list -- users@ovirt.org
To unsubscribe send an email to users-le...@ovirt.org
Privacy Statement: https://www.ovirt.org/site/privacy-policy/
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/users@ovirt.org/message/TG2CJFWZIY7G426UF2FT5CY6EGU4U74Q/

Reply via email to