Compute Resource for vCloud Director

In 1.7 the two sets of interfaces are somewhat disconnected - you'll
have a set under the Network tab for the host, and possibly a set under
the Virtual Machine tab for the created VM, and you'd need both.
Perhaps you only have one set.

In 1.8 it's all unified and you should be able to list them all under
the Network tab.

··· On 16/07/15 17:45, Dave Kirk wrote: > Hi, > > I am trying to create a plugin to provide vCloud Director as a compute > resource, in particular for Foreman v1.7 (we are stuck on this version > currently so it is where I am focusing my effort). > > I have made reasonable progress, so far I have got it listing all VMs in > a VDC, showing a individual VM, powering the VM on/off and creating a > new VM based on a vApp template however I am really struggling with the > Interfaces of a host. > > We need to be able to PXE boot the created VM using the Kickstart > template within Foreman, so I need to be able to add the required > interfaces to a host once it is created as vCloud will assign the MAC > addresses. Currently when I create a host, even if I specify the > interfaces they are never saved to the DB. Is there a particular > property or method that I need to have on the object returned by the > `create_vm` method or on the actual compute resource provider?


Dominic Cleal
Red Hat Engineering

Thanks for the pointer, I don't have any interface fields in compute profile / virtual machine tab so that'll be it.

Going forward I'm guessing 1.8+ will need it's own version of the plugin to support the unified method?

There would be some changes, yes. You'd have to rename a template (see
an existing plugin, e.g.
https://github.com/theforeman/foreman-digitalocean/commit/f077d0ae) and
probably implement the select_nic method in your Fog extensions - see
the impl for vSphere etc in Foreman core for an example. That matches
the created interface to the one that was requested by the user. The
rest hasn't really changed.

Generally I advise that you branch the plugin when trying to support new
versions of Foreman, and change the plugin's major version.

··· On 17/07/15 08:46, Dave Kirk wrote: > Thanks for the pointer, I don't have any interface fields in compute profile / virtual machine tab so that'll be it. > > Going forward I'm guessing 1.8+ will need it's own version of the plugin to support the unified method?


Dominic Cleal
Red Hat Engineering

So I looked through the VMware and LibVirt models and added the Network
section to the compute profile, however I have clearly misunderstood how
this works as when I tried to add interfaces there it would only save the
last interface added, and would never display the correct selections after
selecting a compute profile.

So far I have got the compute resource creating the VMs based on vApp
templates configured in the compute profiles and displaying the VMs within
the datacenter so you can interact with them (power them on and off) but it
appears it's not possible to manage the interfaces and therefore PXE boot
when interacting with vCloud Director, which is a shame

··· On Friday, July 17, 2015 at 9:00:18 AM UTC+1, Dominic Cleal wrote: > > On 17/07/15 08:46, Dave Kirk wrote: > > Thanks for the pointer, I don't have any interface fields in compute > profile / virtual machine tab so that'll be it. > > > > Going forward I'm guessing 1.8+ will need it's own version of the plugin > to support the unified method? > > There would be some changes, yes. You'd have to rename a template (see > an existing plugin, e.g. > https://github.com/theforeman/foreman-digitalocean/commit/f077d0ae) and > probably implement the select_nic method in your Fog extensions - see > the impl for vSphere etc in Foreman core for an example. That matches > the created interface to the one that was requested by the user. The > rest hasn't really changed. > > Generally I advise that you branch the plugin when trying to support new > versions of Foreman, and change the plugin's major version. > > -- > Dominic Cleal > Red Hat Engineering >