crowbar/barclamp-provisioner — pull request #212 by VictorLowther (2013-10-10 18:21:39+00:00)
Title: Allow the provisioner to deploy nodes with Ubuntu 12.04 installed on them. [3/4]

This pull request series adds the ability to deploy Ubuntu on nodes
that have completed the Sledgehammer discovery cycle. Some important
caveats:

* This is a proof of concept implementation of the OS deployment
process. It is hardcoded to install Ubuntu, and no effort has been
given to deploying other Linux distros for now.
* There are some race conditions that can lead to noderoles spuriously
transitioning to ERROR. Trtrying them in the UI usually resolves it
-- my next patch series will target the jig/noderole race conditions
that appear to be leading to the spurious errors.
* It has only been testec by PXE installing virtual machines. Real
hardware might work if the disks have been wiped by something else.
* After binding the provisioner-os-install role to the nodes, they may
reboot back into Sledgehammer instead of booting into the Ubuntu
installer. If that happens, leave them alone and they will
eventually boot into the Ubuntu installer. This is another
manifestation of the jig/noderole race conditions.

With that in mind, here is what you need to do to boot other nodes
into Ubuntu:

* Perform an admin node bringup like normal.
* Boot other nodes on the admin network. They should boot into
Sledgehammer and have all thair noderoles bound.
* Wait for all the noderoles to go active.
* Create a new deployment, add the provisioner-os-install role to that
deployment, then drag all the non-admin nodes onto the
provisioner-os-install role.
* Commit the new deployment.
* Wait until the nodes give you an Ubuntu login prompt.
* Wait until all the noderoles in the system deployemnt turn green again.

chef/cookbooks/dhcp/providers/subnet.rb | 12 +-
chef/cookbooks/dhcp/recipes/default.rb | 5 +-
chef/cookbooks/dhcp/resources/subnet.rb | 1 +
.../dhcp/templates/default/subnet.conf.erb | 2 +
chef/cookbooks/provisioner/providers/bootfile.rb | 4 +-
chef/cookbooks/provisioner/providers/ubuntu.rb | 84 ++++++++
.../cookbooks/provisioner/recipes/make_ssh_keys.rb | 15 +-
.../provisioner/recipes/setup_base_images.rb | 1 +
chef/cookbooks/provisioner/recipes/update_nodes.rb | 60 ++----
chef/cookbooks/provisioner/resources/bootfile.rb | 1 +
chef/cookbooks/provisioner/resources/ubuntu.rb | 21 ++
.../provisioner/templates/default/control.sh.erb | 12 +-
.../templates/default/crowbar_join.ubuntu.sh.erb | 222 ++-------------------
.../templates/default/net-post-install.sh.erb | 31 +--
.../provisioner/templates/default/net_seed.erb | 12 +-
chef/roles/provisioner-server/role-template.json | 1 +
crowbar.yml | 4 +
.../models/barclamp_provisioner/dhcp_database.rb | 67 +++----
.../app/models/barclamp_provisioner/os_install.rb | 37 ++++
.../roles/provisioner-os-install/01-install-os.sh | 8 +
.../provisioner-os-install/role-template.json | 5 +
21 files changed, 279 insertions(+), 326 deletions(-)

Crowbar-Pull-ID: bd66348553d542ca5099c3c0ee4e662fe322da9f

Crowbar-Release: development