Jump to: navigation, search

Difference between revisions of "Ironic/NovaBaremetalIronicMigration"

(Nova Bare-metal to Ironic migration)
Line 1: Line 1:
 
== Nova Bare-metal to Ironic migration ==
 
== Nova Bare-metal to Ironic migration ==
The purpose of this wiki to to provide an understanding of the Nova Bare-metal to Ironic migration process.  First is a list of assumptions we took to write this document and the physical requirements for the migration to successfully complete. Next the entire upgrade process at a high level, leading to a detailed example of each step.  
+
 
 +
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 the entire upgrade process at a high level, leading to a detailed example of each step.
 +
 
 
=== Assumptions / Requirements ===
 
=== Assumptions / Requirements ===
* Migration is only supported *within* Juno release
 
* Migrating live instances between virt drivers in Nova is not tested! It is '''NOT''' recommended.
 
* Migrating from Icehouse-baremetal -> Juno-ironic is not supported
 
* The nova-compute and nova-scheduler will need to be restarted
 
* Icehouse Nova deployed with:
 
** Nova "bare-metal" driver
 
** Populated nova_bm database
 
** Nova Juno release admin upgrades applied
 
* A correctly set up [[#https://github.com/openstack/diskimage-builder|Diskimage-builder]]
 
  
 +
This section descibes 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 therefor 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.
  
 
=== High Level Walk Through ===
 
=== High Level Walk Through ===
* Build deploy-ironic kernel and ram-disk ([[#Build_kernel_and_ram-disk|Example]])
+
 
* Create empty Ironic database ([[#Create_empty_database|Example]])
+
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.
* Start maintenance period (to prevent API service access for upgrade)
+
 
* Stop Nova services ([[#Stop_services|Example]])
+
* Prepare the "deploy-ironic" kernel and initrd for use with the PXE driver
 +
** Build the kernel and initrd images using ''diskimage-builder'' ([[#Build_kernel_and_ram-disk|Example]])
 +
** Load these images into glance ([[#Load_kernel_and_ram-disk|Example]])
 +
** If you plan to use another driver, prepare the appropriate image(s) for that driver instead.
 +
* Initialize the Ironic schema using ''ironic-dbsync'' ([[#Create_empty_database|Example]])
 +
* Begin maintenance period, preventing user access to Nova, which will last until the migration is complete.
 +
* Stop Nova compute and scheduler services ([[#Stop_services|Example]])
 
* Update nova-compute configuration  (nova.conf)
 
* Update nova-compute configuration  (nova.conf)
 
** Change settings ([[#Changes|Example]])
 
** Change settings ([[#Changes|Example]])
 
** '''Add''' an [ironic] section ([[#Ironic_section|Example]])
 
** '''Add''' an [ironic] section ([[#Ironic_section|Example]])
 
** '''Remove''' the [baremetal] section ([[#Baremetal_section|Example]])
 
** '''Remove''' the [baremetal] section ([[#Baremetal_section|Example]])
* Load Deploy-Ironic kernel and ram-disk into glance ([[#Load_kernel_and_ram-disk|Example]])
 
 
* Update flavor metadata to reference Ironic's deploy kernel & ramdisk  ([[#Update_flavor|Example]])
 
* Update flavor metadata to reference Ironic's deploy kernel & ramdisk  ([[#Update_flavor|Example]])
 
* Run [[#https://github.com/openstack/ironic/blob/master/ironic/migrate_nova/migrate_db.py|migrate_db]] script  ([[#Run_migrate_script|Example]])
 
* Run [[#https://github.com/openstack/ironic/blob/master/ironic/migrate_nova/migrate_db.py|migrate_db]] script  ([[#Run_migrate_script|Example]])
 
* Start Ironic services  ([[#Start_Ironic_services|Example]])
 
* Start Ironic services  ([[#Start_Ironic_services|Example]])
 
* Ensure proper service start-up ([[#Ensure_service_start-up|Example]])
 
* Ensure proper service start-up ([[#Ensure_service_start-up|Example]])
* (Re)start Nova services ([[#Start_Nova_services|Example]])
+
* (Re)start Nova compute and scheduler services ([[#Start_Nova_services|Example]])
 
* End maintenance period
 
* End maintenance period
  

Revision as of 15:59, 15 September 2014

Nova Bare-metal to Ironic migration

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 the entire upgrade process at a high level, leading to a detailed example of each step.

Assumptions / Requirements

This section descibes 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 therefor 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.

High Level Walk Through

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.

  • Prepare the "deploy-ironic" kernel and initrd for use with the PXE driver
    • Build the kernel and initrd images using diskimage-builder (Example)
    • Load these images into glance (Example)
    • If you plan to use another driver, prepare the appropriate image(s) for that driver instead.
  • Initialize the Ironic schema using ironic-dbsync (Example)
  • Begin maintenance period, preventing user access to Nova, which will last until the migration is complete.
  • Stop Nova compute and scheduler services (Example)
  • Update nova-compute configuration (nova.conf)
  • Update flavor metadata to reference Ironic's deploy kernel & ramdisk (Example)
  • Run migrate_db script (Example)
  • Start Ironic services (Example)
  • Ensure proper service start-up (Example)
  • (Re)start Nova compute and scheduler services (Example)
  • End maintenance period

Detailed examples

Below are detailed examples of the steps required to migrate Nova Bare-metal to Ironic.

Note these are general examples and differ slightly from your configuration.
Build kernel and ram-disk

Use Diskimage-builder to create the Ironic deploy kernel and ram-disk

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

For MySql

 mysql -u root -e "create schema ironic"
 ironic-dbsync --config-file etc/ironic/ironic.conf.local
Stop services
 sudo service nova-compute stop
 sudo service nova-scheduler stop
Changes

In an editor change the current compute_driver and scheduler_host_manager to match the example below:

 compute_driver = nova.virt.ironic.IronicDriver
 scheduler_host_manager = nova.scheduler.ironic_host_manager.IronicHostManager
Ironic section

Add the Ironic section to the bottom of the nova.conf file: (adjusting the sample below to match your settings)

 [ironic]
 admin_username = ironic
 admin_password = password
 admin_url = http://keystone.host:35357/v2.0
 admin_tenant_name = service
Baremetal section

Remove the entire Nova Bare-metal driver section:

 [Baremetal] 
 sql_connection = db
 tftp_root = /tftpboot
 flavor_extra_specs = cpu_arch / arch
 driver = nova.virt.baremetal.pxe.PXE
 pxe_network_config=True
 pxe_deploy_timeout= pxe_deploy_timeout
 power_manager = power_manager
 virtual_power_host_user=user
 virtual_power_host_key=/mnt/state/var/lib/nova/virtual-power-key
 virtual_power_ssh_host=ssh_host
 virtual_power_type=type
Load kernel and ram-disk

Load the Ironic deploy kernel and ramdisk built above into glance.

 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}')
Update flavor

Update the Nova flavor to reference the deploy-ironic kernel and ram-disk loaded into glance.

 nova flavor-key baremetal set "baremetal:deploy_kernel_id"="$dkid"
 nova flavor-key baremetal set "baremetal:deploy_ramdisk_id"="$drid"
Run migrate script
 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
 sudo service ironic-api start
 sudo service ironic-conductor start
Ensure service start-up
 TBA
Start Nova services
 sudo service nova-compute start
 sudo service nova-scheduler start