LoginSignup
0
0

More than 5 years have passed since last update.

Openstack - Nova Migration (non live migration) to Different Hypervisor between AZ

Last updated at Posted at 2015-12-13

Nova Migration Type

The migration types are:

  1. Non-live migration (sometimes referred to simply as ‘migration’)
    The instance is shut down for a period of time to be moved to another hypervisor. In this case, the instance recognizes that it was rebooted.

  2. Live migration (or ‘true live migration’)
    Almost no instance downtime. Useful when the instances must be kept running during the migration.
    The different types of live migration are:

    • 2-1. Shared storage-based live migration.
      Both hypervisors have access to shared storage.
    • 2-2. Block live migration
      No shared storage is required. Incompatible with read-only devices such as CD-ROMs and Configuration Drive (config_drive).
    • 2-3. Volume-backed live migration
      Instances are backed by volumes rather than ephemeral disk, no shared storage is required, and migration is supported (currently only available for libvirt-based hypervisors).

What's this?

1.Non-live migration の AZ 間

Nova instance (shutoff 状態) を別 AZ の Hypervisor (Compute node) へ移動

[Case]

  1. Cinder volume を接続していない場合
  2. Cinder volume を接続している場合

[条件]

  • Nova instance は shutoff 状態
  • Shared Storage 無し
  • 移動する際に Target Hypervisor (Compute node) は指定出来ない (移動先は Nova scheduler しだい)

[Case1] Migrate Nova instance (w/o Cinder volume)

Initial state

Hypervisor (Compute node)

# nova hypervisor-list
+----+-----------------------+
| ID | Hypervisor hostname   |
+----+-----------------------+
| 6  | node-27               |
| 9  | node-28               |
| 15 | node-31               |
+----+-----------------------+

AZ

# nova availability-zone-list | egrep -A 10 "^\| nova"
| nova                     | available                              |
| |- node-27               |                                        |
| | |- nova-compute        | enabled :-) 2015-02-24T07:30:02.000000 |
| |- node-28               |                                        |
| | |- nova-compute        | enabled :-) 2015-02-24T07:30:07.000000 |
| nova2                    | available                              |
| |- node-31               |                                        |
| | |- nova-compute        | enabled :-) 2015-02-24T07:30:02.000000 |
+--------------------------+----------------------------------------+

Nova instance is on node-31 of AZ:nova2

# nova list --field name,status,,OS-EXT-STS:vm_state,OS-EXT-AZ:availability_zone,OS-EXT-SRV-ATTR:hypervisor_hostname
+--------------------------------------+------------+---------+--+----------------------+------------------------------+--------------------------------------+
| ID                                   | Name       | Status  |  | OS-EXT-STS: Vm State | OS-EXT-AZ: Availability Zone | OS-EXT-SRV-ATTR: Hypervisor Hostname |
+--------------------------------------+------------+---------+--+----------------------+------------------------------+--------------------------------------+
| a17a480c-6b04-4cb6-8767-f17a8477be92 | admin_vm01 | SHUTOFF |  | stopped              | nova2                        | node-31                              |
+--------------------------------------+------------+---------+--+----------------------+------------------------------+--------------------------------------+

Migrate Nova instance

Migration

# nova migrate --poll admin_vm01
Server migrating... 100% complete
Finished

Check the migration result

Nova instance is moved from node-31 of AZ:nova2 to node-27 of AZ:nova

# nova list --field name,status,,OS-EXT-STS:vm_state,OS-EXT-AZ:availability_zone,OS-EXT-SRV-ATTR:hypervisor_hostname
+--------------------------------------+------------+---------------+--+----------------------+------------------------------+--------------------------------------+
| ID                                   | Name       | Status        |  | OS-EXT-STS: Vm State | OS-EXT-AZ: Availability Zone | OS-EXT-SRV-ATTR: Hypervisor Hostname |
+--------------------------------------+------------+---------------+--+----------------------+------------------------------+--------------------------------------+
| a17a480c-6b04-4cb6-8767-f17a8477be92 | admin_vm01 | VERIFY_RESIZE |  | resized              | nova                         | node-27                              |
+--------------------------------------+------------+---------------+--+----------------------+------------------------------+--------------------------------------+

Confirm previous size

Resize confirm

# nova resize-confirm admin_vm01

Check

The status is changed from VERIFY_RESIZE to SHUTOFF

# nova list --field name,status,,OS-EXT-STS:vm_state,OS-EXT-AZ:availability_zone,OS-EXT-SRV-ATTR:hypervisor_hostname
+--------------------------------------+------------+---------+--+----------------------+------------------------------+--------------------------------------+
| ID                                   | Name       | Status  |  | OS-EXT-STS: Vm State | OS-EXT-AZ: Availability Zone | OS-EXT-SRV-ATTR: Hypervisor Hostname |
+--------------------------------------+------------+---------+--+----------------------+------------------------------+--------------------------------------+
| a17a480c-6b04-4cb6-8767-f17a8477be92 | admin_vm01 | SHUTOFF |  | stopped              | nova                         | node-27                              |
+--------------------------------------+------------+---------+--+----------------------+------------------------------+--------------------------------------+

Boot Nova instance on new hypervisor (Compute node)

Boot

# nova start admin_vm01

Check

# nova list --field name,status,,OS-EXT-STS:vm_state,OS-EXT-AZ:availability_zone,OS-EXT-SRV-ATTR:hypervisor_hostname
+--------------------------------------+------------+--------+--+----------------------+------------------------------+--------------------------------------+
| ID                                   | Name       | Status |  | OS-EXT-STS: Vm State | OS-EXT-AZ: Availability Zone | OS-EXT-SRV-ATTR: Hypervisor Hostname |
+--------------------------------------+------------+--------+--+----------------------+------------------------------+--------------------------------------+
| 34eb51cd-0585-4098-8b01-97f9c0ab8ea9 | admin_vm01 | ACTIVE |  | active               | nova                         | node-27                              |
+--------------------------------------+------------+--------+--+----------------------+------------------------------+--------------------------------------+

[Case2] Migrate Nova instance (w/ Cinder volume)

Initial State

Hypervisor (Compute node)

# nova hypervisor-list
+----+-----------------------+
| ID | Hypervisor hostname   |
+----+-----------------------+
| 6  | node-27               |
| 9  | node-28               |
| 15 | node-31               |
+----+-----------------------+

AZ

# nova availability-zone-list | egrep -A 10 "^\| nova"
| nova                     | available                              |
| |- node-27               |                                        |
| | |- nova-compute        | enabled :-) 2015-02-24T07:30:02.000000 |
| |- node-28               |                                        |
| | |- nova-compute        | enabled :-) 2015-02-24T07:30:07.000000 |
| nova2                    | available                              |
| |- node-31               |                                        |
| | |- nova-compute        | enabled :-) 2015-02-24T07:30:02.000000 |
+--------------------------+----------------------------------------+

Nova instance is on node-27

# nova list --field name,status,,OS-EXT-STS:vm_state,OS-EXT-AZ:availability_zone,OS-EXT-SRV-ATTR:hypervisor_hostname
+--------------------------------------+------------+---------+--+----------------------+------------------------------+--------------------------------------+
| ID                                   | Name       | Status  |  | OS-EXT-STS: Vm State | OS-EXT-AZ: Availability Zone | OS-EXT-SRV-ATTR: Hypervisor Hostname |
+--------------------------------------+------------+---------+--+----------------------+------------------------------+--------------------------------------+
| a17a480c-6b04-4cb6-8767-f17a8477be92 | admin_vm01 | SHUTOFF |  | stopped              | nova                         | node-27                              |
+--------------------------------------+------------+---------+--+----------------------+------------------------------+--------------------------------------+

With Cinder volume

# cinder list
+--------------------------------------+-----------+--------------+------+-------------+----------+--------------------------------------+
|                  ID                  |   Status  | Display Name | Size | Volume Type | Bootable |             Attached to              |
+--------------------------------------+-----------+--------------+------+-------------+----------+--------------------------------------+
| 0ad60220-3b04-416d-a1ee-880f85ef54b4 |   in-use  | admin_vol01  |  1   |     None    |  false   | a17a480c-6b04-4cb6-8767-f17a8477be92 |
+--------------------------------------+-----------+--------------+------+-------------+----------+--------------------------------------+

# cinder show admin_vol01 | egrep "Property|availability_zone"
|            Property            | Value                   |
|       availability_zone        | nova                    |

# nova show admin_vm01 | egrep "Property|volumes_attached"
| Property                             | Value                                                    |
| os-extended-volumes:volumes_attached | [{"id": "0ad60220-3b04-416d-a1ee-880f85ef54b4"}]         |

Migrate Nova instance

Migration

# nova migrate --poll admin_vm01
Server migrating... 0% complete
Server migrating... 0% complete
^CShutting down novaclient

Check the migration result

Migration was failed.

BUG : https://bugs.launchpad.net/nova/+bug/1454252

# nova list --field name,status,,OS-EXT-STS:vm_state,OS-EXT-AZ:availability_zone,OS-EXT-SRV-ATTR:hypervisor_hostname
+--------------------------------------+------------+--------+--+----------------------+------------------------------+--------------------------------------+
| ID                                   | Name       | Status |  | OS-EXT-STS: Vm State | OS-EXT-AZ: Availability Zone | OS-EXT-SRV-ATTR: Hypervisor Hostname |
+--------------------------------------+------------+--------+--+----------------------+------------------------------+--------------------------------------+
| a17a480c-6b04-4cb6-8767-f17a8477be92 | admin_vm01 | RESIZE |  | stopped              | nova                         | node-27                              |
+--------------------------------------+------------+--------+--+----------------------+------------------------------+--------------------------------------+

Environment

  • Openstack : Juno
  • Ceph : Firefly

Reference

Nova Migration (non live migration) to Different Hypervisor
Nova Migration (non live migration) to Different Hypervisor between AZ
Nova Migration (true live migration) to Different Hypervisor
Nova Migration (true live migration) to Different Hypervisor between AZ
Nova Migration (Manually) between AZ
Nova Migration (Manually) between Region
Nova Migration (true live migration) to Different Hypervisor - Volume-backend live migration (instance)
Nova Migration (true live migration) to Different Hypervisor - Volume-backend live migration (instance) between AZ

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0