Update to support filling out template with networking interfaces #2

Merged
merged 8 commits into from Oct 30, 2015

Conversation

Projects
None yet
2 participants
Contributor

jameinel commented Oct 29, 2015

This adds a few more templates and some other busywork. But the key items are:

  1. "--template" parameter to allow other templates to be used easily
  2. "--subnet" parameter which lets you say that you want this node to be on some particular CIDRs. These must be Networks that are already defined in both virt-manager and in MAAS.
  3. "--debug" wtf is going on?

I've seen a few strange failures, but in general with this script I've been able to register a new node that has 2 network interfaces and get them put onto a different virtual bridge and have maas recognize that the interface is on a different subnet.

I'd certainly appreciate feedback at this point, as it has grown fairly large. Though I think a good next step would be a script that lets you create new subnets and have them registered in both libvirt (virsh) and in MAAS.

jameinel added some commits Oct 28, 2015

change 'conf' to 'settings' so it doesn't confuse the internal settings
from the conf object we use to define the node itself.
handle multiple interfaces. Looks like it comes back as a list rather than
as an OrderedDict. For now we just pull off one of the addresses and use that.

Also, allow specifying the template as a parameter, instead of only supporting 1 template.
Fix a bug in add_to_maas wrt a variable that didn't exist.
Back when it was a module-level global from the if clause it accidentally
matched the same object as self.settings, but that was never actually
intended to work.
Don't require an Opteron_G5 as the CPU and use 'trusty' instead of ut…
…opic.

Clearly that isn't going to work everywhere, but we have the --template parameter
now, so we can have a few templates that work.
explicitly commission the node with skip_networking and skip_storage …
…(may not be useful).

futher, set the hostname of the machine to match the virsh name of the machine.
start modeling what subnets we know about (based on CIDRs) and being …
…able to bring up interfaces in them.

Wait for the node to reach Ready status, and then record in MAAS the information about the
subnets that the node's interface is on.
Contributor

jameinel commented Oct 29, 2015

I should mention that it also does things like name the MAAS node to match the machine name that you gave to virsh.

dooferlad added a commit that referenced this pull request Oct 30, 2015

Merge pull request #2 from jameinel/master
Update to support filling out template with networking interfaces

@dooferlad dooferlad merged commit dd1eaa4 into dooferlad:master Oct 30, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment