Migrate images to/from KVM / vCenter DS¶
OpenNebula allows the management of hybrid environments, offering end-users a self-service portal to consume resources from both VMware-based infrastructures and KVM based ones to the user in a transparent way.
We are going to show you both transition below step-by-step trough Sunstone:
VMDK Image to QCOW2 Datastore¶
Here is how it works. We have a vmdk image within MarketPlace and we want to use it in KVM:
- Go to MarketPlace and select the image, then click on Download Button.
When the destination image datastore is qcow2/raw you must define the attribute
DRIVER=raw, respectively, in order to convert the image. If not, the image will be download without any change.
- Select the destination datastore.
- Create a template in order to use the new image.
- Instantiate the template and check that it works.
QCOW2 Image to VMDK Datastore¶
The process is very similar to the one described above.
- Go to MarketPlace and select the image in qcow2 format to be used in a vCenter cluster, then click on Download Button.
In this case, when you import a vcenter datastore is automatically set
DRIVER=vcenter so we dont need to define DRIVER attribute.
- Select the destination image datastore.
- When we download a vmdk image from the marketplace, a template is automatically created along with the image. However, we need a template with a valid vcenter ref for your cloud. You need to define an empty template in vcenter and import it in OpenNebula.
- Now, clone the empty template to make use of the downloaded image.
- Attach the image to the cloned template, so we can keep the original for other VMs.
- Finally, instantiate the template.
How it was implemented¶
Everytime the image that we selected from MarketPlace is downloaded to the frontend. Then, when the download process is finished, it is converted with the
qemu-img convert tool as follows:
qemu-img convert -f <original_type> -O <destination_type> <original_file> <destination_file>
Then, the file is sent to the destination datastore.
Limitations and restrictions¶
We have to take into account that when we convert an image from qcow2/raw to vmdk, the contextualization is lost so, we will have to install VMWare tools manually.