Merge lp://staging/~freyes/maas-deployer/virtual-nodes into lp://staging/maas-deployer

Proposed by Felipe Reyes
Status: Merged
Merged at revision: 69
Proposed branch: lp://staging/~freyes/maas-deployer/virtual-nodes
Merge into: lp://staging/maas-deployer
Diff against target: 263 lines (+195/-13)
2 files modified
examples/virtual-nodes.yaml (+166/-0)
maas_deployer/vmaas/engine.py (+29/-13)
To merge this branch: bzr merge lp://staging/~freyes/maas-deployer/virtual-nodes
Reviewer Review Type Date Requested Status
Nobuto Murata Needs Fixing
Billy Olsen Approve
Review via email: mp+289115@code.staging.launchpad.net

Description of the change

Maintainers,

I would like to add the option to create virtual machines (virtual-nodes) and get them registered into the freshly installed maas.

This MP includes a exmple yaml file to understand how this is intended to be used.

Rationale
---------

maas-deployer already has all the plumbing needed to create (through virsh) and register VMs/bare-metal (into MAAS), but some scenarios (specially labs and bug reproducers) require to create extra VMs for the workload that it's intended to be deployed with juju (typically OpenStack), so I pretend to use this for that, as a tool to build disposable labs easily.

Best,

To post a comment you must log in.
Revision history for this message
Billy Olsen (billy-olsen) wrote :

In general, I'm +1 on this. I feel that the virtual-nodes set is something that may be confusing rather than just nodes, however I do understand why its there (so there's a distinction of nodes to create and nodes which are expected to be present). I really waffled back and forth about whether to use virtual-nodes or to use a tag inside of a node, but ultimately it doesn't matter that much so I'll approve as is.

review: Approve
Revision history for this message
Nobuto Murata (nobuto) wrote :

Wait, the branch seems not based on /next branch. So some changes in /next have been lost. For example, 'architecture'='amd64/generic' is hard-coded again (I'm using maas-deployer for ppc64el as well). The branch should be re-based and re-submitted.

------------------------------------------------------------
revno: 69 [merge]
committer: Billy Olsen <email address hidden>
branch nick: next
timestamp: Fri 2016-04-15 17:03:06 -0700
message:
  [freyes, r=billy-olsen]

  Add 'virtual-nodes' config key to create extra VMs during deployment.
    ------------------------------------------------------------
    revno: 63.1.2
    committer: Felipe Reyes <email address hidden>
    branch nick: maas-deployer.bzr
    timestamp: Tue 2016-03-15 13:11:10 -0300
    message:
      Add example on how to create virtual nodes during deployment
    ------------------------------------------------------------
    revno: 63.1.1
    committer: Felipe Reyes <email address hidden>
    branch nick: maas-deployer.bzr
    timestamp: Mon 2016-03-14 18:55:46 -0300
    message:
      Add 'virtual-nodes' config key to create extra VMs

=== modified file 'maas_deployer/vmaas/engine.py'
--- maas_deployer/vmaas/engine.py 2016-04-15 16:18:34 +0000
+++ maas_deployer/vmaas/engine.py 2016-04-17 17:07:02 +0000
@@ -77,20 +80,21 @@ class DeploymentEngine(object):
         self.wait_for_import_boot_images(client, maas_config)
         self.configure_maas(client, maas_config)

- def _get_juju_node_params(self, juju_domain, juju_config, maas_config):
+ def _get_node_params(self, node_domain, node_config, maas_config,
+ tags=None):
         """
- Determines the mac address of the juju machine specified.
+ Determines the mac address of the node machine specified.

- :param juju_domain: the juju bootstrap image domain
+ :param node_domain: the juju bootstrap image domain
         :param include_power: a boolean value of whether to include
                               power parameters or not for virsh power
                               control.
         """
         node = {
- 'name': juju_domain.name,
- 'architecture': juju_config.get('arch'),
- 'mac_addresses': [x for x in juju_domain.mac_addresses],
- 'tags': 'bootstrap'
+ 'name': node_domain.name,
+ 'architecture': 'amd64/generic',
+ 'mac_addresses': [x for x in node_domain.mac_addresses],
+ 'tags': tags if tags else node_config['tags'],
         }

         virsh_info = maas_config.get('virsh')

review: Needs Fixing

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches