From e3f0848ccd9c36e0be3c106dee0aee6d9cbe8bce Mon Sep 17 00:00:00 2001 From: Deepti Navale Date: Thu, 30 Jan 2014 14:11:24 +1000 Subject: [PATCH] Included instance migration using snapshots Included new procedure for migrating an instance using snapshots in the User guide. Closes-bug: #1244353 Change-Id: I6b4606e923682161fe6c21dd0ccabd92184af937 --- doc/user-guide/ch_cli.xml | 2 + .../section_cli_nova_migrate_instances.xml | 139 ++++++++++++++++++ 2 files changed, 141 insertions(+) create mode 100644 doc/user-guide/section_cli_nova_migrate_instances.xml diff --git a/doc/user-guide/ch_cli.xml b/doc/user-guide/ch_cli.xml index 7d4ca9f315..69bd27ccc2 100644 --- a/doc/user-guide/ch_cli.xml +++ b/doc/user-guide/ch_cli.xml @@ -29,6 +29,8 @@ --> + + +
+ + Use snapshots to migrate instance + + Some cloud providers allow only administrators to + perform these steps. + + To use snapshots to migrate instances from OpenStack + projects to clouds, complete these steps: + + + Create a snapshot of the instance. + + + Download the snapshot as an image. + + + Import the snapshot to the new environment. + + + Boot a new instance from the snapshot. + + + + Perform the and procedures in the source + project. + Perform the and in the destination + project. + +
+ Create a snapshot of the instance + + + Always shut down the source VM before you take the + snapshot to make sure that all data is flushed to + disk. + $ nova list + +--------------------------------------+------------+--------+------------------------------+ + | ID | Name | Status | Networks | + +--------------------------------------+------------+--------+------------------------------+ + | c41f3074-c82a-4837-8673-fa7e9fea7e11 | example | ACTIVE | private=10.0.0.3 | + +--------------------------------------+------------+--------+------------------------------+ + $ nova stop example + + + Confirm that the instance shows a SHUTOFF + status. + $ nova list + +--------------------------------------+------------+---------+------------------------------+ + | ID | Name | Status | Networks | + +--------------------------------------+------------+---------+------------------------------+ + | c41f3074-c82a-4837-8673-fa7e9fea7e11 | example | SHUTOFF | private=10.0.0.3 | + +--------------------------------------+------------+---------+------------------------------+ + + + + Use the nova + image-create command to take a snapshot. Use the nova + image-list command to check the status until the status + is ACTIVE: + $ nova list + +--------------------------------------+------------+---------+------------------------------+ + | ID | Name | Status | Networks | + +--------------------------------------+------------+---------+------------------------------+ + | c41f3074-c82a-4837-8673-fa7e9fea7e11 | example | SHUTOFF | private=10.0.0.3 | + +--------------------------------------+------------+---------+------------------------------+ + $ nova image-create --poll example examplesnapshot + Instance snapshotting... 50% complete + $ nova image-list + +--------------------------------------+---------------------------------+--------+--------+ + | ID | Name | Status | Server | + +--------------------------------------+---------------------------------+--------+--------+ + | 657ebb01-6fae-47dc-986a-e49c4dd8c433 | cirros-0.3.1-x86_64-uec | ACTIVE | | + | 72074c6d-bf52-4a56-a61c-02a17bf3819b | cirros-0.3.1-x86_64-uec-kernel | ACTIVE | | + | 3c5e5f06-637b-413e-90f6-ca7ed015ec9e | cirros-0.3.1-x86_64-uec-ramdisk | ACTIVE | | + | f30b204e-1ce6-40e7-b8d9-b353d4d84e7d | examplesnapshot | ACTIVE | | + +--------------------------------------+---------------------------------+--------+--------+ + + +
+
+ Download the snapshot as an image + + + Get the image ID: + $ nova image-list ++--------------------------------------+------------------+--------+--------------------------------------+ +| ID | Name | Status | Server | ++--------------------------------------+------------------+--------+--------------------------------------+ +| f30b204e-1ce6-40e7-b8d9-b353d4d84e7d | examplesnapshot | ACTIVE | c41f3074-c82a-4837-8673-fa7e9fea7e11 | ++--------------------------------------+------------------+--------+--------------------------------------+ + + + Download the snapshot by using the image ID that + was returned in the previous step: + $ glance image-download --file snapshot.raw f30b204e-1ce6-40e7-b8d9-b353d4d84e7d + + The glance image-download + command requires the image ID and cannot use + the image name. + Ensure there is sufficient space on the + destination file system for the image + file. + + + + Make the image available to the new environment, + either through http or with direct upload to a + machine (scp). + + +
+
+ Import the snapshot to new environment + + + In the new project or cloud environment, import + the snapshot: + $ glance image-create --copy-from IMAGE_URL + + +
+
+ Boot a new instance from the snapshot + + + In the new project or cloud environment, use the + snapshot to create the new instance: + $ nova boot --flavor m1.tiny --image EXAMPLE_SNAPSHOT NEW_INSTANCE + + +
+