How to Download OpenStack image in PMO?
Problem
How to download images available in the PMO environment.
Environment
- Platform9 Managed OpenStack - v4.0 and Higher
- Image v1,v2
Procedure
To download image using OpenStack cli, image must show the active status.
- Use
openstack image list
to list out the images available in the environment. - Use
openstack image save --file <FILE_NAME> <IMAGE_ID>
to download the image locally.
- Replace <FILE_NAME> with the path and name of the file you want to save the image as on your local system. Include the appropriate extension for the image format (e.g., .qcow2 or .img).
- Replace <IMAGE_ID> with the ID of the image you created.
x
# openstack image save --file test.qcow2 2f87a3cc-86df-4128-8be1-de7638793dc1
]# ls -lh
total 895M
-rw-r--r-- 1 root root 465 Feb 29 16:37 admin_admin.rc
-rw-------. 1 root root 6.8K Jan 28 2019 anaconda-ks.cfg
-rwxr-xr-x 1 root root 4.3K Mar 1 07:06 backup.sh
drwxr-xr-x 2 root root 6 Feb 29 16:53 bin
-rw-------. 1 root root 6.5K Jan 28 2019 original-ks.cfg
-rw-r--r-- 1 root root 895M May 8 03:31 test.qcow2
To download an image using curl request, image must show the active status.
Generate the OS_TOKEN using the "openstack token issue" command.
Export the token ID in OS_TOKEN.
Execute curl command to download the image
curl -H "X-Auth-Token: $OS_TOKEN" -X GET "http://<FQDN>:9292/v2/images/<UUID>/file" -o file.qcow2
Where,
<FQDN> - Is the management plane fqdn
<UUID> - Image uuid
Was this page helpful?