Neutron/MigrationFromNovaNetwork/HowTo

Overview
This wiki describes step-by-step procedure for migrating servers from Nova network to Neutron. Before proceeding with the actual migration process, it is highly recommended to test the migration process by executing steps described in How to test migration process first.

TODO - fill in the migration process script here -

How to test migration process
Following section is written with the intent for the readers to try the migration process before actually moving existing servers (VMs).

In this section, we create VMs using Nova network, and then perform migration steps to move them over to Netutron network. This test process is performed by using devstack.

NOTE: Before proceeding with the migration process, please ensure that your system meets the Prerequisites


 * 1) Apply devstack patch in devstack directory. This patch allows both Nova and Neutron networks to be available at the same time
 * 2) Restack
 * execute unstack.sh followed by stack.sh
 * 1) Apply novaclient patch in /opt/stack/python-novaclient directory
 * 2) Pull  Neutron migration patch from github
 * 3) Now create few servers (VMs) by using nova boot  command
 * nova boot --flavor= --image= vm1
 * 1) Verify that the VMs are created and are in Active State
 * nova list
 * 1) Now modify nova.conf to use neutron - as shown below
 * network_api_class = nova.network.neutronv2.api.API
 * firewall_driver = nova.virt.firewall.NoopFirewallDriver
 * service_neutron_metadata_proxy = True
 * security_group_api = neutron
 * neutron_migrating = True
 * [neutron]
 * url = http://:9696
 * region_name = RegionOne
 * admin_tenant_name = service
 * auth_strategy = keystone
 * admin_auth_url = http://:35357/v2.0
 * admin_password =
 * admin_username = neutron
 * 1) Restart Nova
 * restart n-cpu and n-api services
 * 1) Create a Neutron network and subnet. This is needed only if you are not using devstack created network.
 * 2) Migrate a VM to form Nova network to Neutron by issuing following command
 * nova migration-to-neutron  
 * Note that during migration process, additional VMs can not be launched.
 * 1) Once all servers (VMs) have been migrated, disable the migration. This is done by updating the /etc/nova/nova.conf  as follows:
 * neutron_migrating = True
 * 1) Restart Nova
 * restart n-cpu and n-api services
 * 1) Now you can launch additional servers (VMs). These will be launched in Neutron network
 * nova migration-to-neutron  
 * Note that during migration process, additional VMs can not be launched.
 * 1) Once all servers (VMs) have been migrated, disable the migration. This is done by updating the /etc/nova/nova.conf  as follows:
 * neutron_migrating = True
 * 1) Restart Nova
 * restart n-cpu and n-api services
 * 1) Now you can launch additional servers (VMs). These will be launched in Neutron network

Prerequisites
Prior to starting the migrating process ensure that following requirements are met:


 * libvirt library should be at version 1.2.5. To upgrade this library, please follow steps described here
 * python-libvirt should also be at version 1.2.5. Upgrade of libvirt should do this automatically. If for some reason it is not upgrades, please follow steps described here to upgrade this library

Upgrading libvirt library
Use following steps to upgrade libvirt library:

Check present version by using "virsh --version". If the present version is at 1.2.5, skip rest of this section, otherwise continue


 * Download and unpack libvirt version 1.2.5 from here
 * Install pkg-config, if not already installed
 * Install libnl-dev, if not already installed
 * Configure libvirt by following these steps:
 * ./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc
 * make
 * sudo make install
 * restart the libvirt service
 * Verify the version to ensure that library was correctly installed by executing "virsh --version"

unix_sock_group = "libvirtd" unix_sock_rw_perms = "0770" auth_unix_ro = "none" auth_unix_rw = "none"
 * Update /etc/libvirt/libvirtd.conf with:

Upgrading python-libvirt library
Note that python-libvirt version must match with the libvirt version. Use following steps to upgrade python-libvirt library:


 * Download and unpack python-libvirt version 1.2.5 from here
 * Install python-libvirt by following these steps:
 * python setup.py build
 * sudo python setup.py install