How to transfer an image between two OpenStack platforms?
I have access to two distinct OpenStack platforms, which I will call A and B. I have a glance image on platform A, and I would like to transfer it to platform B. The image is the result of a snapshot of a virtual machine.
At the moment, I do the following steps:
- (make sure the OpenStack CLI is installed on my personal computer)
- authenticate to A
- download the image from A to my PC (e.g. with
openstack image save --file <filename> <image>
) - authenticate to B
- upload the image from my PC to B (e.g. with
openstack image create --file <filename> <name>
)
This does the work. However, since my PC sits on a slow separate network, the transfer tends to take a very long time. Also, this three-step procedure A -> PC -> B
does not seem like an efficient approach in general, especially when one has no need to save a local copy of the image that is being transferred.
Is it possible transfer the image from A to B directly, thus avoiding the intermediate step? And if it is, how can I do it?
You could save the image to stdout, then pipe it into a curl command (I don't think
openstack image create
can read from stdin).Before that, you need to create the destination catalog entry.
It seems the glance client can upload image data from stdin (
glance image-create
).And or course you can transfer it from A to B without going through the PC.
Thank you for your answer. With the solution that you are suggesting, wouldn't the traffic still pass through my PC? I understand that thanks to the i/o redirection I do not have to buffer the data in a tempoirary file, however that would still not be a direct transfer
A -> B
as far as I can tell.When you run the command on a server in A or B, I/O doesn't pass through the PC.
This is certainly true if I can access both machines with SSH. However, all I have is OpenStack credentials, so I am wondering if it is possible to transfer the image using the OpenStack APIs only.