[ovirt-users] python floppy in RunOnce mode

Juan Hernández jhernand at redhat.com
Thu Jan 7 10:25:07 UTC 2016


On 01/07/2016 10:52 AM, Giulio Casella wrote:
> Hi Juan,
> I've been using something you suggested some month ago (see below) to 
> start windows 7 VMs and perform the sysprep specialize phase.
> Some days ago I updated rhev from 3.5.3.1-1.4.el6ev to 
> 3.5.6.2-0.1.el6ev, and that code is not working anymore (no sysprep 
> floppy attached).
> I noticed that when params.Action() is empty, VMs start in normal mode, 
> not "run once". So I tried to fill it with a vm:
> 
> action = params.Action(vm=params.VM(name="myvm"))
> 
> This way VM starts in "run once" mode, but, again, no sysprep floppy is 
> attached, and no proper specialization is applied (e.g. windows domain 
> join is not performed).
> 
> Any hints?
> 
> Thanks in advance,
> Giulio Casella
> 

The sysprep logic is only triggered once, the first time you start the
VM. So you will need to create it again, set the initialization data and
start it, basically repeat the steps that I suggested.

There were some bugs around this behaviour, some still not fixed in 3.5,
and it wasn't clear when the VM will use or not use sysprep, so we have
introduced a flag to explicitly force use of sysprep.

Please try to use this flag:

action = params.Action(use_sysprep=True)
vm.start(action)

> 
> 
> Il 27/12/2014 17:38, Juan Hernández ha scritto:
>> #!/usr/bin/env python
>>
>> from ovirtsdk.api import API
>> from ovirtsdk.xml import params
>>
>> api = API(
>>    url="https://ovirt.example.com/ovirt-engine/api",
>>    username="admin at internal",
>>    password="******",
>>    ca_file="/etc/pki/ovirt-engine/ca.pem"
>> )
>>
>> vm = api.vms.get(name="myvm")
>>
>> initialization = params.Initialization()
>> vm.set_initialization(initialization)
>> vm.update()
>>
>> action = params.Action()
>> vm.start(action)
>>
>> api.disconnect()
> 
> _______________________________________________
> Users mailing list
> Users at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/users
> 


-- 
Dirección Comercial: C/Jose Bardasano Baos, 9, Edif. Gorbea 3, planta
3ºD, 28016 Madrid, Spain
Inscrita en el Reg. Mercantil de Madrid – C.I.F. B82657941 - Red Hat S.L.



More information about the Users mailing list