Jump to: navigation, search

Difference between revisions of "Ironic/NovaBaremetalIronicMigration"

Line 106: Line 106:
   |                        | u'ssh_address': u'', u'ssh_key_contents': u'-----BEGIN RSA |
   |                        | u'ssh_address': u'', u'ssh_key_contents': u'-----BEGIN RSA |
   |                        | PRIVATE KEY-----                                                        |
   |                        | PRIVATE KEY-----                                                        |
   |                        | <SSH KEY REMOVED                                                                     |
   |                        | <SSH KEY REMOVED>                                                      |
   |                        | -----END RSA PRIVATE KEY-----'}                                        |
   |                        | -----END RSA PRIVATE KEY-----'}                                        |
   | extra                  | {}                                                                      |
   | extra                  | {}                                                                      |

Revision as of 14:38, 16 September 2014

Migration from Nova Baremetal to Ironic

The purpose of this wiki to to provide an understanding of the migration process from Nova's "baremetal" driver to its "ironic" driver. First is a list of assumptions we took to write this document and the physical requirements for the migration to successfully complete. Next, a high-level description of the upgrade process is provided, followed by a detailed example of each step.

Assumptions / Requirements

This section describes assumptions made about the operating environment in which the upgrade can be performed, and is a reflection of the environment used in the continuous upgrade testing that will be performed on the Juno stable branch. An upgrade may be possible under other circumstances as well.

  • Only a "sideways" migration within the Juno release is supported. In other words:
    • migrating from Juno "baremetal" to Juno "ironic" is supported, but:
    • migrating from Icehouse "baremetal" to Juno "ironic" is not supported.
  • Migrating live instances between virt drivers in Nova is not tested, and therefore is not recommended.
    • That being said, we have had some success in migrating a live "baremetal" instance to "ironic" and then deleting it.
  • Upgrading from Icehouse "baremetal" to Juno "baremetal" is not tested upstream, but we are not aware of any bugs affecting this upgrade.

Migration Steps

This section outlines the recommended approach for an operator to perform a sideways migration from the Juno release of Nova "baremetal" driver to the Juno release of the Nova "ironic" driver.

Please note that the examples provided may differ slightly from your environment.

Install Ironic

Install Ironic by following the steps described in these two sections of Ironic's install guide:

  1. Install and Configure Prerequisites
  2. Configure the Bare Metal Service. Do not start the Ironic services (the last step) just yet.
Prepare the "deploy-ironic" kernel and initrd for use with the driver

These instructions are for the PXE driver. If you plan to use another driver, prepare the appropriate image(s) for that driver instead.

Use diskimage-builder to create the Ironic deploy kernel and RAM disk. For example, the following will create the kernel and RAM disk in deploy-ironic.kernel and deploy-ironic.initramfs files respectively:

 diskimage-builder/bin/ramdisk-image-create -a $NODE_ARCH $NODE_DIST deploy-ironic -o deploy-ironic $DIB_ELEMENTS

Load the Ironic deploy kernel and RAM disk built above into Glance. For example:

 dkid=$(glance image-create --name "deploy-ironic-kernel" --public --disk-format aki --file deploy-ironic.kernel | awk ' / id / {print $4}')
 drid=$(glance image-create --name "deploy-ironic-ramdisk" --public --disk-format ari --file deploy-ironic.initramfs | awk ' / id / {print $4}')
Begin maintenance period

In order to prevent users from accessing Nova, begin your maintenance period. The maintenance will end when the migration is completed.

Stop Ironic's and Nova's services

If Ironic services are running, stop them:

 sudo service ironic-api stop
 sudo service ironic-conductor stop

If Nova services are running, stop the compute and scheduler services:

 sudo service nova-compute stop
 sudo service nova-scheduler stop
Update nova-compute configuration to use Ironic
  1. Follow steps 1 and 2 of Configure Compute Service to use the Bare Metal Service to change some settings and add an [ironic] section
  2. Remove the entire [baremetal] section
Update Nova baremetal's flavor metadata

Update the Nova "baremetal" flavor metadata to reference the deploy-ironic kernel and RAM disk loaded into Glance. For example:

 nova flavor-key baremetal set "baremetal:deploy_kernel_id"="$dkid"
 nova flavor-key baremetal set "baremetal:deploy_ramdisk_id"="$drid"
Run the migrate_db script

The ironic-nova-bm-migrate script will migrate Nova baremetal node and interface information and associated driver configuration from the Nova database to the Ironic database. It only supports migrating from the IPMI and VirtualPowerManager power drivers.

 ironic-nova-bm-migrate --nova-bm-db $database_connection_url_nova_bm \
     --ironic-db $database_connection_url_ironic \
     --node-arch x86_64 \
     --nova-conf $NOVA_CONF_FILE
Start Ironic services

(Re)start the Ironic services via:

 sudo service ironic-api start
 sudo service ironic-conductor start
Ensure Ironic services start-up

Before running the "ironic" commands below, be sure that the required OS_* environment variables are set / sourced. (More information is available at ironic Command-Line Interface).

 ironic driver-list

should produce output like this sample:

 | name         | hosts  |
 | pxe_ipmitool | ubuntu |
 | pxe_ssh      | ubuntu |
Note that the above list may not match your output exactly; it depends on the drivers you've enabled. If this is the first time starting the Ironic services, it is advisable to check the Ironic logs for errors.

Then run a "node-list" to ensure that the nodes have migrated correctly:

 ironic node-list

This should produce a list such as:

 | uuid                                 | instance_uuid | power_state | provision_state | maintenance |
 | 36f24e67-aaec-41ba-ba20-509bdd548974 | None          | power off   | None            | False       |
 | 77024bdb-a360-419f-a0b5-bc18a97571c1 | None          | power off   | None            | False       |

Inspect each node in detail with the node-show command. The migration script populated the node's uuid, instance_uuid, created_at, updated_at, power_state, driver, and driver_info, instance_info, and properties from its Nova baremetal node:

 ironic node-show
 | Property               | Value                                                                   |
 | instance_uuid          | None                                                                    |
 | target_power_state     | None                                                                    |
 | properties             | {u'memory_mb': u'2048', u'cpu_arch': u'i386', u'local_gb': u'40',       |
 |                        | u'cpus': u'1'}                                                          |
 | maintenance            | False                                                                   |
 | driver_info            | {u'ssh_username': u'nobodycam', u'ssh_virt_type': u'virsh',             |
 |                        | u'ssh_address': u'', u'ssh_key_contents': u'-----BEGIN RSA |
 |                        | PRIVATE KEY-----                                                        |
 |                        | <SSH KEY REMOVED>                                                       |
 |                        | -----END RSA PRIVATE KEY-----'}                                         |
 | extra                  | {}                                                                      |
 | last_error             | None                                                                    |
 | created_at             | 2014-09-15T17:50:59+00:00                                               |
 | target_provision_state | None                                                                    |
 | driver                 | pxe_ssh                                                                 |
 | updated_at             | 2014-09-15T18:24:15+00:00                                               |
 | instance_info          | {}                                                                      |
 | chassis_uuid           | None                                                                    |
 | provision_state        | None                                                                    |
 | reservation            | None                                                                    |
 | power_state            | power off                                                               |
 | console_enabled        | False                                                                   |
 | uuid                   | 36f24e67-aaec-41ba-ba20-509bdd548974                                    |
(Re)start Nova's compute and scheduler services
 sudo service nova-compute start
 sudo service nova-scheduler start
End maintenance period

You are done!