How to Move a VM Between Zones in CloudStack or CloudPlatform

In our blog last week we discussed How to Move VM's to a New or Different Account in CloudStack, and this week we are going to take it one step further to outline how to move them between zones in the same Apache CloudStack or Citrix CloudPlatform cloud environment. 

Before we get started, you have to understand what a zone is in CloudStack. According to CloudStack documentation a zone is one or more pods and secondary storage. Typically zones are considered a data center; however, you may deploy multiple zones in a single data center. The zone level is where you define secondary storage, public IP addresses for system VM and guest VM consumption, and a (contiguous, or noncontiguous) range of VLANs for network isolation.

Now that you understand what a zone is, it is time to walk through the steps of migrating VMs between them. Note: These steps should be performed from the CloudStack web interface and by an administrator. We also include some recommendations that Appcore uses during this process.

  1. Login to CloudStack or Citrix CloudPlatform as a administrator (make sure to log into the account the virtual machines belongs to.

  2. Select the instance (virtual machine) you need to migrate, then select "View Volumes".

  3. Select the volume that needs to be migrated and click the "Take Snapshot" button.

  4. Once the snapshot is complete, click "View Snapshots" and select the most recent snapshot taken. If the volume is the ROOT volume, Click "Create Template". If it is a DATA volume, move forward to step 6.

  5. A popup will appear. Fill out the Name, Description, and select correct OS Type. The OS type must be the same as the original VM. The “Public” check box allows the template to be visible to all users in the cloud, so only check this box if you intend to have everyone in every account have this template accessible to them. If you do not check this box it will only be available in your account under My Templates. Appcore advises that “Password Enabled” is check to enable the password reset feature.

  6. After the template has been created, select the “Templates” tab on the left, select the template you just created, then click “Copy Template”. Another pop up will appear asking which zone to copy to. Select the new zone.

  7. If a volume is not a ROOT volume, but a DATA volume, under that volume’s snapshots, select the newest one and click “Create Volume” and give the new volume a name.

  8. Once the new volume has been created, click the “Storage” tab on the left and select the new volume you just created and click “Download Volume”. A URL will appear. Copy that URL and go back to the main “Storage” tab.

  9. At the “Storage” tab, on the upper right corner, click “Upload Volume”. A pop up will appear. Give the volume a name, select the new zone under “Availability Zone”, and select the appropriate volume format. Paste the URL from the previous step and click OK.

  10. The Volume will begin downloading to the new zone. Once is has completed, you can create a new instance in  the new zone and attach the volume to that new VM.

If you are a new user to CloudStack or CloudPlatform, I hope you find this information useful. As a CloudStack consultants, we often get asked for instructions on this process. In response, I have created a detailed guide with images as well. To download it, CLICK HERE. If you have any further questions, please let us know by calling our support line or on Twitter @appcore.