In the more recent versions you have to use 'use_cloud_init=True' in the
api, which isn't described in most documentation yet. Maybe thats the
reason it isn't working?
Here's a working snippet:
vm = api.vms.get(name=vm_name)
action = params.Action(
use_cloud_init=True,
vm=params.VM(
initialization=params.Initialization(
regenerate_ssh_keys=True,
host_name=vm_fqdn,
nic_configurations=params.GuestNicsConfiguration(
nic_configuration=[
params.GuestNicConfiguration(
name="eth0",
boot_protocol="static",
on_boot=True,
ip=params.IP(
address=vm_address,
netmask=vm_netmask,
gateway=vm_gateway,
),
),
],
),
),
),
)
vm.start(action)
On Tue, Mar 29, 2016 at 2:03 PM, Arpit Makhiyaviya <arpit.icreate(a)gmail.com>
wrote:
Hello,
we are using ovirt api with json data format.
we have create vm from template and i want to set ip,macaddress,user and
password for that we are using cloud_init for that we it can't set any
options.
Regards,
*Arpit Makhiyaviya*
Software Engineer
+91-79-40038284
+91-971-437-6669
<
http://www.sculptsoft.com>
_______________________________________________
Users mailing list
Users(a)ovirt.org
http://lists.ovirt.org/mailman/listinfo/users