Openstack to Cloudstack Template Migration


This blog covers the image/template migration between Openstack to Cloudstack platform. To be precise, converting the image from QCOW2 format to VHD format and upload it to Cloudstack platform.  

Requirements

  • Root access privileges to openstack and cloudstack with Xen server platform
  • Enough free space to do the conversion
  • python 2.7 to run a http server

Image Download

This part is already covered in one of my existing blogs. Please refer https://benyraja.blogspot.in/2017/03/templateimage-migration-with-reduced.html 'Image Download' section.

Image Conversion

Once we have downloaded the image to local disk, we have to convert it into VHD as it is the supported version of Cloudstack Xen hypervisor. If you are using KVM hypervisor, then we can skip to next step. Use the below command to convert the image from QCOW2 to VHD.

$ qemu-img convert -O vpc

Now you will have the converted image in VHD format.

Image Upload/Register Template

To register templates in Cloudstack, we must have a URL without authentication. Here we will use python to create a temporary http server to generate URL for our vhd image. Run the below command inside the folder, where the VHD image is stored.

$  python -m SimpleHTTPServer 80

We can use any port other than '80' also. Now, we can type the local IP in the browser to get the vhd image link.

http:// will show all the files inside the folder. We have to right click on the VHD image and select 'copy link' option. That will be the direct URL for the VHD template.

Once you logged into cloudstack, go to 'Templates' and click 'Register Template' 



In the pop up window, we have to enter the details including the URL that we have copied in the previous step. Click 'ok' and the SSVM will start uploading the template from the URL to secondary storage.


To view the upload status of the template, click the template name, select 'zones' and there we can see the status of the image. When the status changed to "Download Complete" and ready changed to "Yes", we can use the image to launch new VM instances.



Comments

Popular posts from this blog

HA-Proxy setup for Openstack Services

Amazon CloudFront