Jump to: navigation, search

Difference between revisions of "Neutron/MigrationFromNovaNetwork/HowTo"

 
(12 intermediate revisions by the same user not shown)
Line 3: Line 3:
  
 
This wiki describes step-by-step procedure for migrating servers from Nova network to Neutron.
 
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|Test Migration Process First]]
+
<br/>
 +
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|How to test migration process]] first.
  
  
Line 20: Line 21:
  
 
<br />
 
<br />
#<big> Update Devstack to use Nova Network by applying [http://paste.openstack.org/show/84178/ devstack patch] in devstack directory </big>
+
#<big> Apply [http://paste.openstack.org/show/84178/ devstack patch] in devstack directory. This patch allows both Nova and Neutron networks to be available at the same time </big>
#<big> Apply [http://paste.openstack.org/show/84117/ novaclient patch] in /opt/stack/python-novaclient directory </big>
+
#:
 +
#<big> Restack </big>
 +
#:          <pre><nowiki>    execute unstack.sh followed by stack.sh      </nowiki></pre>
 +
#:
 +
#<big> Apply [http://paste.openstack.org/show/84177/ novaclient patch] in /opt/stack/python-novaclient directory </big>
 +
#:
 +
#<big> Pull  [https://review.openstack.org/#/c/100265/ Neutron migration patch] from github </big>
 +
#:
 
#<big> Now create few servers (VMs) by using nova boot  command </big>
 
#<big> Now create few servers (VMs) by using nova boot  command </big>
#:          <pre><nowiki>    nova boot --flavor=1 --image= vm1      </nowiki></pre>
+
#:          <pre><nowiki>    nova boot --flavor=<flavor-id> --image=<Image-id>  vm1      </nowiki></pre>
 
#<big> Verify that the VMs are created and are in Active State  </big>
 
#<big> Verify that the VMs are created and are in Active State  </big>
 
#:          <pre><nowiki>    nova list          </nowiki></pre>
 
#:          <pre><nowiki>    nova list          </nowiki></pre>
#<big> Now modify nova.conf to use neutron </big>
+
#<big> Now modify nova.conf to use neutron - as shown below</big>
#:             network_manager = nova.network.neutronv2.api.API         
+
#:                 network_api_class = nova.network.neutronv2.api.API         
                firewall_driver = nova.virt.firewall.NoopFirewallDriver
+
#:                firewall_driver = nova.virt.firewall.NoopFirewallDriver
                service_neutron_metadata_proxy = True
+
#:                service_neutron_metadata_proxy = True
                security_group_api = neutron
+
#:                security_group_api = neutron
                neutron_migrating = True
+
#:                neutron_migrating = True
#<big> Migrate a VM to form Nova network to Neutron by issuing "nova migration-to-neutron <vm-id> <neutron-net-id>"</big>
+
#:
 +
#:                [neutron]
 +
#:                url = http://<host-ip>:9696
 +
#:                region_name = RegionOne
 +
#:                admin_tenant_name = service
 +
#:                auth_strategy = keystone
 +
#:                admin_auth_url = http://<host-ip>:35357/v2.0
 +
#:                admin_password = <password>
 +
#:                admin_username = neutron
 +
#:
 +
#<big> Restart Nova </big>
 +
#:          <pre><nowiki>    restart n-cpu and n-api services      </nowiki></pre>
 +
#<big> Create a Neutron network and subnet. This is needed only if you are not using devstack created network. </big>
 +
#:
 +
#<big> Migrate a VM to form Nova network to Neutron by issuing following command</big>
 +
#:          <pre><nowiki>    nova migration-to-neutron <vm-id> <neutron-net-id>         </nowiki></pre>
 +
#:  Note that during migration process, additional VMs can not be launched.
 +
#<big> Once all servers (VMs) have been migrated, disable the migration. This is done by updating the /etc/nova/nova.conf  as follows:</big>
 +
#:          <pre><nowiki>    neutron_migrating = True        </nowiki></pre>
 +
#<big> Restart Nova </big>
 +
#:          <pre><nowiki>    restart n-cpu and n-api services      </nowiki></pre>
 +
#<big> Now you can launch additional servers (VMs). These will be launched in Neutron network </big>
 +
 
 +
 
  
  
 +
<br/>
 
=== Prerequisites ===
 
=== Prerequisites ===
 
Prior to starting the migrating process ensure that following requirements  are met:
 
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 [[#Upgrading libvirt library|here]]
 
* libvirt library should be at version 1.2.5. To upgrade this library, please follow steps described [[#Upgrading libvirt library|here]]
* python-libvirt should also be at version 1.2.5
+
* 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 [[#Upgrading python-libvirt library|here]] to upgrade this library
  
 
<br/>
 
<br/>
Line 48: Line 80:
 
Check present version by using "virsh --version". If the present version is at 1.2.5, skip rest of this section, otherwise continue
 
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 [http://libvirt.org/sources/ from here]
+
* Download and unpack libvirt version 1.2.5 from [http://libvirt.org/sources/ here]
 
* Install pkg-config, if not already installed
 
* Install pkg-config, if not already installed
 
* Install libnl-dev, if not already installed
 
* Install libnl-dev, if not already installed
Line 55: Line 87:
 
** make
 
** make
 
** sudo make install
 
** sudo make install
 +
** restart the libvirt service
 
* Verify the version to ensure that library was correctly installed by executing "virsh --version"
 
* Verify the version to ensure that library was correctly installed by executing "virsh --version"
 +
 +
* Update /etc/libvirt/libvirtd.conf with:
 +
      unix_sock_group = "libvirtd"
 +
      unix_sock_rw_perms = "0770"
 +
      auth_unix_ro = "none"
 +
      auth_unix_rw = "none"
 +
  
 
<br/>
 
<br/>
Line 63: Line 103:
 
Use following steps to upgrade python-libvirt library:
 
Use following steps to upgrade python-libvirt library:
  
* Download and unpack python-libvirt version 1.2.5 from [https://pypi.python.org/pypi/libvirt-python/ from here]
+
* Download and unpack python-libvirt version 1.2.5 from [https://pypi.python.org/pypi/libvirt-python/ here]
 
* Install python-libvirt by following these steps:  
 
* Install python-libvirt by following these steps:  
 
** python setup.py build
 
** python setup.py build
 
** sudo python setup.py install
 
** sudo python setup.py install

Latest revision as of 21:18, 11 July 2014

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      
  3. Apply novaclient patch in /opt/stack/python-novaclient directory
  4. Pull Neutron migration patch from github
  5. Now create few servers (VMs) by using nova boot command
        nova boot --flavor=<flavor-id> --image=<Image-id>  vm1      
  6. Verify that the VMs are created and are in Active State
        nova list          
  7. 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://<host-ip>:9696
    region_name = RegionOne
    admin_tenant_name = service
    auth_strategy = keystone
    admin_auth_url = http://<host-ip>:35357/v2.0
    admin_password = <password>
    admin_username = neutron
  8. Restart Nova
        restart n-cpu and n-api services      
  9. Create a Neutron network and subnet. This is needed only if you are not using devstack created network.
  10. Migrate a VM to form Nova network to Neutron by issuing following command
        nova migration-to-neutron <vm-id> <neutron-net-id>         
    Note that during migration process, additional VMs can not be launched.
  11. 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        
  12. Restart Nova
        restart n-cpu and n-api services      
  13. 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"
  • Update /etc/libvirt/libvirtd.conf with:
     unix_sock_group = "libvirtd"
     unix_sock_rw_perms = "0770"
     auth_unix_ro = "none"
     auth_unix_rw = "none"



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