[ovirt-users] cloud_init not apply when v create from API

Renout Gerrits mail at renout.nl
Tue Mar 29 12:54:12 UTC 2016


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 at 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 at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ovirt.org/pipermail/users/attachments/20160329/24b54d10/attachment-0001.html>


More information about the Users mailing list