Openstack:Extending COE

From DocWiki

Revision as of 00:57, 9 May 2013 by Michchap (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Directory structure

The directory structure of a COE install will look like this:

/etc/puppet

Is created when puppet is installed. It should essentially contain this on the appropriate branch (usually multi-node). This repo contains the manifests and templates directories where the one part of COE will reside.

/etc/puppet/manifests

Contains the site.pp, which is used to customise the install in common ways, such as configuring the network settings and defining which nodes to manage. Site.pp is internally documented and will be different for each site. This directory also has core.pp and cobbler_node.pp: core.pp is used to provide a clean interface between the Openstack puppet modules and the user-facing site.pp; cobbler_node.pp is specifically targeted at managing the cobbler module. The scripts in the directory are helpers that perform the following functions:

  • clean_node.sh Is used to wipe the puppet cert of a node and set it to install on next boot. Usage: clean_node.sh $target_node
  • puppet-modules.sh Is used to install all the modules in modules.list via apt. Usage puppet-modules.sh
  • reset_build_node.sh Will clean up the build node so that a subsequent puppet apply will test with a (roughly) clean slate. Purges installed packages, removes var directories and some config files. Usage: reset_build_node.sh
  • reset_nodes.sh Removes all nodes from cobbler db and then runs puppet to insert them again. Usage: reset_nodes.sh

/etc/puppet/templates

Contains a template for /etc/network/interfaces. This can be modified by sites that have complex networks to meet their requirements. It is applied via a late command and not directly managed by puppet. The second file in this directory can be used to move IP addresses between physical nics and Openvswitch ports and is not needed in the majority of cases. It is controlled by numbered_vs_port in site.pp.

/etc/puppet/modules or /usr/share/puppet/modules

Either of these locations can be used to house the puppet modules. The COE apt packages will install them to /usr/share/puppet/modules.

apache         cobbler   concat    drbd      horizon   memcached  naginator  openstack        puppet    rsync   sysctl
apt            coe       corosync  glance    inifile   monit      nova       openstack_admin  quantum   ssh     vswitch
apt-cacher-ng  collectd  dnsmasq   graphite  keystone  mysql      ntp        pip              rabbitmq  stdlib  xinetd

Understanding the install sequence

Because COE handles both provisioning of the base OS and deployment of applications the install sequence for a node is quite long. The install takes the following steps:

  1. COE puppet modules and manifests are installed on the build node from either git or apt
  2. Puppet apply is run on the build node, which does the following:
    1. Cobbler is installed on the build node
    2. The Ubuntu 12.04 install image is loaded into cobbler using cobbler-import-ubuntu-x86_64
    3. The out-of-band information for the target node is inserted into the cobbler database
    4. A preseed file is created to automate the install, which has the following in the late command:
      1. Sets puppet to run after the node has booted, depending on whether autostart_puppet has been set
      2. Sets the puppetmaster address and sync interval in puppet.conf
      3. Syncs to the build node ntp server
      4. Optionally disables IPv6 router advertisement
      5. Optionally installs the ethernet bonding module
      6. Sets /etc/network/interfaces based on /etc/puppet/templates/interfaces.erb in the late command
      7. HTTP posts to cobbler on the build node to say that the install completed successfully
      8. HTTP posts to cobbler on the build node to request no more install boots (so the machine will receive a PXE command to boot from local disk instead)
  3. The target node is rebooted using the clean_node.sh script on the build node, or by hand, which will install ubuntu and run everything in step 2.4
  4. The target node will finish the install, reboot, then boot into the newly installed OS
  5. If autostart_puppet has been set, the node will run puppet agent, and install everything needed for either a control or a compute node.

Most of the complexity here is tied up in the late command. If you need to add a system module and want it to be available as soon as the system reboots (for example ethernet bonding) then this is the place to put it. In the manifests folder, there is

Rating: 5.0/5 (2 votes cast)

Personal tools