This guide will show you how to move or copy your instance to a different project, region or cloud provider.
- Installed OpenStack CLI client - https://kb.citynetwork.eu/kb/how-to-articles/control-panel/access-a-project-via-cli
- Access to source and target location (RC-file)
- Enough space on the machine you download your server to.
- Target location configured with Network, Security Groups etc.
To speed up this work, we recommend to use a temporary linux instance located at the same place as the source or target location. This make the transfer faster not needing to downloading to and uploading from your local machine.
Creating a snapshot
First step will be to create a snapshot of the instance. We recommend you to shutdown the instance while this is done to ensure data consistency. When snapshot is done, you can start you instance again.
We always recommend to use the ID or UUID of the server to make sure you are working with the correct one.
To get the the correct UUID of your server, you can see it in the control panel or list it in CLI with the following command:
Now you have to create a snapshot of your instance using the following command:
After a short while you will get some output showing information on the new image, and also the state. It's probably queue and you need to wait until it's in active state before continue.
To see that actual status of the image and also the image_id, use the following command:
Image creation is completed when status is active.
Download your snapshot
Next step is to check which disk format the image has (normally raw or qcow2), and you can check this with the following command:
Now you have to download your snapshot to your local machine or created server used for this move. You apply the disk_format and image_id from the output of the 2 commands above.
When the file have been downloaded, you are done with the steps on the source side, and the following steps will be done on the target side.
Load the rc-file for the target side. Instructions how to generate this can be found in the link to OpenStack client installation in the beginning of this guide.
Upload your snapshot
Start upload the file to the new location and use disk_format from above and also the name you want to give the image.
Upload will take a while, and after getting your prompt back, you can check the status by using the following command.
When status is active, the uploadupload is done.
Create a new server.
Next step you need to do, is to create a new server from the uploaded image. This can be done either with CLI commands or via the control panel ( https://admin.citycloud.com ). The following steps are from then control panel.
Choosing Images and Private Images in the side panel, you will see the newly uploaded image.
Select Create a server shown by clicking the blue dot to the right on the row for the image you have uploaded.
Fill in the new name, size, network etc.
Remember that the volume needs to be at least the same size as the source server.
If you are using password to the server, you need to set the password for the new server by adding the following cloud-config rows under Advanced Options. If you miss this step you will not be able to login to the server and need to recreate it again.
You now learned how you can download and upload instances using snapshots and launch the instance into a different region, project or OpenStack cloud provider by using the CLI tools.
After you have moved your instance and don't want to keep the old one, don't forget to remove it to save some cost.