Skip to content

This guide helps you in the process to migrate an existing machine booting from image to another one using boot from volume.

When migrating a Windows instance, beware that a Local Administrator account needs to be present in order to be able to boot a new machine. Without the Administrator account locally available, the instance may be unusable.

Migrate your instance to boot from volume using the CLI

If you want to migrate your instance that is locally running on an hypervisor to a boot from volume instance, please follow the steps below. Please take note that you need to adapt the commands, we are using migrateVM as the name of the machine to migrate.

  1. Stop the machine that you want to migrate.
$ openstack server stop migrateVM
  1. Create an snapshot of the instance
$ openstack server image create --name migrateVM_snapshot migrateVM
  1. When the image is marked as active, create a volume that uses as source the snapshot taken before. Specify as size a value bigger or equal than min_size
$ openstack image show migrateVM_snapshot
+----------------------------+--------------------------------------+
| Property                   | Value                                |
+----------------------------+--------------------------------------+
| base_image_ref             | bc16bc4b-f925-46f1-af05-96aa6407b076 |
| checksum                   | e6a0323b52a1a8933f08c2e7c74d4795     |
| container_format           | bare                                 |
| created_at                 | 2016-09-12T06:06:29Z                 |
| disk_format                | VHD                                  |
| hypervisor_type            | hyperv                               |
| id                         | 746877c7-2445-46cb-9c47-f179d4efb126 |
| image_type                 | snapshot                             |
| instance_type_ephemeral_gb | 0                                    |
| instance_type_flavorid     | 50                                   |
| instance_type_id           | 28                                   |
| instance_type_memory_mb    | 2048                                 |
| instance_type_name         | win.small                            |
| instance_type_root_gb      | 61                                   |
| instance_type_rxtx_factor  | 1.0                                  |
| instance_type_swap         | 0                                    |
| instance_type_vcpus        | 1                                    |
| instance_uuid              | fe0ad3ce-1173-44f2-8d7f-7eff1e86aee9 |
| min_disk                   | 61                                   |
| min_ram                    | 0                                    |
| name                       | migrateVM_snapshot                   |
| network_allocated          | True                                 |
| old_vm_state               | stopped                              |
| os                         | WINDOWS                              |
| os_version                 | UNKNOWN                              |
| owner                      | f048108f-66d2-48de-bf91-0012fdf6c034 |
| protected                  | False                                |
| size                       | 33426359808                          |
| status                     | active                               |
| tags                       | []                                   |
| updated_at                 | 2016-09-12T07:27:13Z                 |
| user_id                    | my-user-name                         |
| virtual_size               | None                                 |
| visibility                 | private                              |
+----------------------------+--------------------------------------+
$ openstack volume create --size 61 --image migrateVM_snapshot migrateVM_volume
  1. Terminate the previously running instance
$ openstack server delete migrateVM
  1. Wait 10 minutes until the name gets free on DNS
  2. Create a machine with the same name selecting the volume created before as source. Select a similar flavor to the one you had in the previous instance.
$ openstack server create --flavor m2.medium --volume migrateVM_volume migrateVM

Migrate your instance to boot from volume using the web interface

  1. Stop the machine that you want to migrate. On the instances tab, click on the button Stop Instance.
  2. Create an snapshot of the instance. Once the instance is stopped, click on the Create Snapshot button, and give it a name like migrateVM_snapshot.
  3. When the image is marked as active, create a volume that uses as source the snapshot taken before. On the images tab, click on Create Volume. This will launch a form, in which the size is already prefilled with the min_disk. Click Create.
  4. Once the volume is available you can terminate the running instance. Go to the instances tab and click on Terminate Instance
  5. Wait 10 minutes until the name gets free on DNS
  6. Create a machine with the same name selecting the volume created before as source. In the volumes tab, click on the button Launch as Instance. Select a similar flavor as before and specify the same name as the original machine.