[Openstack] How to create an image that can be installed to other hypervisors or load it on other instances in another openstack cloud?

Van Leeuwen, Robert rovanleeuwen at ebay.com
Mon Nov 2 07:22:46 UTC 2015

> Has anyone create an image that can be installed into other hypervisors than openstack?
> I mean that I have the image, (let’s say a Cirros image), on an instance and I make some changes there.
> How can I take that image together with my changes, produce a new image including the original one and the changes of course,
> and load it into other hypervisors like VMware sphere, for instance?

You can simply convert the image (make a snapshot) and convert it with e.g. Qemu-img to vmdk format:
However, if you want to create a standard image for multiple platforms I’d highly suggest to look at tools like packer:
 https://www.packer.io/docs/builders/openstack.html which can output to different formats.

> If I want to take an image from an instance from openstack cloud A and load  it into a VM into another openstack cloud B, will it work? And how?
> Just by loading it to the new VM or do I have to process/change it somehow?

Yes you can. Make a snapshot and import it.
(assuming you are allowed to snapshot and upload your own images.)

> I’m afraid this would mix up the IPs of the two clouds, (internal and external IPs),
> and in general the network configuration would be different on the two openstack cloud environments, so how this can be done?

Usually IP’s are coming from DHCP in some way so it should just pick a IP from the DHCP pool.
If you have exactly the same IP space you could (in theory) boot them with the same IP:
Using the nova boot with "v4-fixed-ip” argument to boot it with a specific IP.
In general I would highly recommend to make it work with whatever DHCP gives you and fix resolving of services with the appropriate tools (DNS / Zookeeper /etcd... )

> I tried to implement this by taking snapshots on my VMs I want the image to be transferred.
> The result was to take a backup of my volume, the one that it is used by the VM.
> The problem here is that if my VM uses, for instance, the xlarge flavor, it means it will take a snapshot of 160GB for an OS only of 12.5 MB, which is really TRAGIC!!!!
> So, under what situations it is preferable to use snapshots?
> This is an extreme example to understand my thought/question and the reason why I cannot use snapshot.

It al depends on what you actually want to achieve what makes the most sense.
A onetime migration from cloud A to B? DR scenario? Running by default with 2 cloud providers?
e.g. it might make more sense to just spawn an instance in the second cloud and e.g. Rsync the data from within the 2 instances.

> By taking a snapshot from a VM as I said it will take a snapshot of the volume used on the specific flavor for a VM. This will take the NFS file as well, right?
>There is no any special volume other than the one used on the flavor storing the > NFS details, correct? Of course, by default openstack installation/configuration

Not sure what you mean by NFS. You can implement nfs in many ways.
Iirc if it is a “separate” cinder volume you need to snapshot that separately.

Robert van Leeuwen

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20151102/0264f5be/attachment.html>

More information about the Openstack mailing list