On Thu, 20 Sep 2018 18:37:40 -0000
"Alan Bunch" <picsdal...@gmail.com> wrote:

> Hello all and thank you in advance for your help.
> 
> I have been able to work out how to add vm via a call to the vms
> API.   I am passing in a template via the api call and that is
> working.  I do not have a network installed in the template. My use
> case for that was to hit “New vm”, fill in the hostname and network
> and let cloud-init set the hostname.  That way I can create a new vm
> with just a few clicks.  
> 
> What I can’t seem to figure out is how to define the network
> interface in the add vm api call.   It looks like I should have to
> add the network interface in a second call after creation.    If I
> add the interface in the  <initialization> section for cloud-init I
> seems to have a chicken and egg problem.  When I add the
> <initialization> section and the data for the ip address, netmask,
> default gateway, I get; <?xml version="1.0" encoding="UTF-8"
> standalone="yes"?> <fault> <detail>[Cannot add VM. Static IPv4
> address is missing in cloud-init configuration.]</detail>
> <reason>Operation Failed</reason> </fault>
> 

In
https://github.com/oVirt/ovirt-system-tests/blob/master/basic-suite-4.2/test-scenarios/004_basic_sanity.py#L894
and
https://github.com/oVirt/ovirt-system-tests/blob/master/network-suite-master/lib/virtlib.py#L79
are examples of how to use cloud-init.

> That would seem to indicate to me that I need and interface before I
> can configure it.  That makes sense.  But how do I get an interface
> before I create the vm ?
> 

If you want to use the python sdk, please find in github.com -
ovirt-engine-sdk how to add a vNIC to a VM. You can add the vNIC after
VM is created, but before the VM is booted the first time.

> What might I be missing?
> 
> The desired result is create a vm and set the hostname and ip info
> via the api so that I get a fully formed vm connected to the
> network.  That gets me to the point of being able to download build
> scripts to install and start puppet.
> 
> Alan
> _______________________________________________
> 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/YQRSABCJ7Y3L44XRFLUFDTFPK6OGBKPH/
_______________________________________________
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/OWBWY5CU3XMDUO4QR3FN7IP45S4PM7Y3/

Reply via email to