On 11/05/2012 07:51 AM, Michael Pasternak wrote:
Hi Romil,
In general you can use api guide [1] for this, anyway here is example:
1. create vm
============
...
2. insert cdrom
===============
vm = api.vms.get(name="myvm")
cdrom = vm.cdroms.get(id="00000000-0000-0000-0000-000000000000")
isofile = params.File(id="myiso.iso")
cdrom.set_file(isofile)
cdrom.update()
3. change boot order (to boot from cdrom and then from hd)
==========================================================
os=params.OperatingSystem(boot=[params.Boot(dev='cdrom'),
params.Boot(dev='hd')], ...)
api.vms.add(params.VM(name='myvm2',
os=os,
cluster=api.clusters.get('mycluster'),
template=api.templates.get('mytemplate')))
use this ^ example for #1, or update boot order using same semantics
on existent vm.
--
Michael Pasternak
RedHat, ENG-Virtualization R&D