Migrate an Instance to a New Project
There will be times when you have an instance in one Red Cloud project and would like to migrate it to a different project. For example, if you have been working in an exploratory project and are transitioning to using a permanent project, you may want to bring along the instances you have created. Migrating an instance between projects can be done through the Red Cloud (Horizon) web interface and is a three stage process:
- Prepare the volume of your source instance.
- Share the volume with the destination project.
- Create an instance in the destination project from the shared volume.
The first two stages must be performed by a user with access to the 'source' project and the last stage must be performed by a user with access to the 'destination' project. The following instructions assume that you are comfortable managing an instance through the Horizon web interface.
Preparing the Source Volume
In this stage, you will be working with the ''volume'' upon which your instance is based. Since the volume is currently "In-Use" by your instance, you will need to delete the instance to make the volume "Available" for sharing. Note that the volume containing the essence of your instance will actually be ''moved'' from the source project to the destination project. If you would like to have copies of the instances in both projects, there is an optional step at the end that lets you do so.
Follow these steps:
- Log in to the Red Cloud web interface and select the source project.
- In Compute->Instances, identify the instance you would like to migrate.
- Using the instance's drop-down menu, detach any additional volumes that are attached to the instance. These must be migrated separately and reattached in the destination project. You will not see the option to detach volumes if your instance is shelved.
- Using the instance's drop-down menu, shelve the instance.
- Click the instance's name in the list to see its details. Scroll to the bottom to find "Volumes Attached" and click on the instance's volume (at this point, there should only be one).
- In the volume's page, click "Edit Volume". In the dialog, change the volume's name to something you will recognize, then click "Submit".
- In the Volumes->Volumes page, use the renamed volume's drop-down menu to "Create Snapshot". Give the snapshot a name you will recognize and click "Create Volume Snapshot". By default, when an instance is deleted, its volume is not deleted. In case that default was overridden when the instance was created, you will be happy to have this snapshot as a backup!
- In the Compute->Instances page, use your instance's drop-down menu to "Delete Instance".
- If you would like to keep a copy of the instance in this project, or if the instance's volume was deleted along with the instance, make a new volume from the snapshot. Go to Volumes->Snapshots, find the snapshot you created and click "Create Volume". If you want to keep a copy of the instance in this project, go to Volumes->Volumes and find the newly created volume, then use its drop-down menu to "Launch as Instance".
- Once you have created any desired volumes from the snapshot, you can delete it. Once the volume from which it was created is moved to another project, the snapshot will be broken, unusable and hard to delete.
Sharing the Source Volume
- In the Volumes->Volumes page, the volume you want to share should now have status "Available".
- Use the volume's drop-down menu to "Create Transfer". In the dialog, give the transfer a name and click "Create Volume Transfer".
- Save the information in the following page by clicking "Download transfer credentials". This information will be needed in stage 3.
- If you detached any volumes in stage 1 that you wish to migrate, you can create separate transfers now for each of them.
Creating an Destination Instance from the Shared Volume
- Select the destination project for the transfer.
- If you don't already have them, create a private network, a security group and a key pair for use with your migrated instance. You may also want to allocate a new floating IP address for the instance.
- In the Volumes->Volumes page, click "Accept Transfer".
- In the dialog, paste the Transfer ID and Authorization Key that you downloaded in stage 2, then click "Accept Volume Transfer".
- In the Volumes page, you should now see the transferred volume, which has the name you assigned to it in stage 1.
- Use the volume's drop-down menu to "Launch as Instance".
- In the dialog, give the instance a name, then select a flavor, a network, a security group and a key pair. In the dialog's "Source" tab, notice that "Select Boot Source" is set to "Volume" and your transferred volume has been selected. Do not change these values. When you have updated all the necessary settings, click "Launch Instance".
- In the Compute-Instances page, your new instance should be starting up.
- If you wanted to migrate additional volumes, accept each of their transfers now and attach the drives to the new instance.