How to Export and Import Image or Instance in OpenStack?

To make data backup or perform VM migration, IT adminstrators often need to export and import VM data. This post will tell how to export and import image and instance in OpenStack.

download-icon

Free Download

for VM, OS, DB, File, NAS, etc.

nick-zhao

Updated by Nick Zhao on 2022/12/20

Table of contents
  • How to export and import image in OpenStack?

  • How to export and import snapshot in OpenStack?

  • How to export and Import volume in OpenStack?

  • How to backup OpenStack with Vinchin Backup & Recovery?

  • Sum Up

OpenStack allows companies to create VM on the cloud computing platform to support all kinds of business systems and can be used with hypervisors like ESXi, Xen, and KVM so it is selected by many companies to improve the work efficiency of IT environment.

There are a lot of useful data in the VMs so IT administrator will export the image or entire VM to save the data like backup or import the image or VM to another host for data migration.

How to export and import image in OpenStack?

The format of OpenStack image is often saved as raw or qcow2 format and you can check the information of the image and then export it with its ID. After that, you can use it to create new VM or import image to any OpenStack host.

1. Source the evnironment variables:

source openrc.sh

2. List the OpenStack image:

openstack image list

You will get the ID of the target image and you can use the ID to check its properties and export the image.

3. Check the properties of the target image

openstack image show id

4. Check the available space in the environment:

df -h

5. Export OpenStack image

glance image-download --file centos6.8.raw id

With the exported image, you can import it to another OpenStack host:

openstack image create --disk-format raw --container-format bare --public --property hw_boot_menu=true --min-disk 20 --min-ram 1024 --property os_admin_user=centos --property os_type=linux --property os_distro=centos --file centos6.8.raw centos68

If you are also using virtualization platforms like VMware, XenServer, Red Hat Virtualization, and want to import OpenStack image to another platform, you can use Vinchin Backup & Recovery to perform V2V migration between OpenStack and virtualization platform.

How to export and import snapshot in OpenStack?

You can create image from VM snapshot in OpenStack so that it means you can use the snapshot to export and import OpenStack VM.

The procedures are like the exporting and importing image in the last section. You need to take a snapshot of the VM to generate an image, and then export and use the image in the same way.

1. Get the list of OpenStack VM:

nova list

You need the VM name and ID for the next steps. If the VM status is ACTIVE, you need to shutdown the VM to make all the data has been written into the image.

2. Shutdown the instance:

nova stop Instance_Name

3. Check instance status:

nova list

The status of the target instance should be SHUTOFF.

4. Take a snapshot of the Instance:

nova image-create --poll Instance_Name Instance_Snapshot_Name

5. Check instance image ID:

nova image-list

6 Export the snapshot:

glance image-download --file snapshot.raw id

Later, you can import the snapshot to new environment:

glance --os-image-api-version 1 image-create

  --container-format bare --disk-format qcow2 --copy-from IMAGE_URL

How to export and Import volume in OpenStack?

You are also allowed to take a snapshot of OpenStack volume, export the snapshot as image and then use the volume in new environment.

1. Get the information of the attached volumes:

openstack volume list

Still you need to have the ID of the target volume.

2. Take a snapshot of the volume:

openstack volume snapshot create --volume id --force snapshot_name

3. Get the information of the volume snapshot:

openstack volume snapshot list

4. Create a volume from the snapshot:

openstack volume create --snapshot id --size customized_size volume_name

5. Get the information of the newly-created volume:

openstack volume list

6. Create a new image from it:

openstack image create --volume volume_name image_name

7. Check the properties of the image:

openstack image show image_name

You will get the complete file name of the image. Its format might be qcow2 or raw.

8. Export the image:

openstack image save --file file_name image_name

Later, you can use the exported volume to create new volume in new environment with openstack volume create command.

How to backup OpenStack with Vinchin Backup & Recovery?

Exporting and importing image and instance can help simply backup and migrate data while companies can have a professional solution for VM data management.

Vinchin Backup & Recovery is the professional backup and disaster recovery solution for OpenStack. There will be user-friendly web console to manage the backup system, including adding all the VMs agentlessly and making backup jobs with many useful strategies like scheduled backup, incremental backup, data encryptions, etc.

Vinchin Backup & Recovery

VM backups will be presented as recovery points in the backup system so you can easily find the right backup you need to recover failed VM or replicate the VM on another host.

You might need to perform V2V migration to move VM from OpenStack to VMware, XenServer, Red Hat Virtualization, etc. and this will be very easy in Vinchin Backup & Recovery. Vinchin Backup & Recovery also supports VM backup for VMware, XenServer, Red Hat Virtualization, etc. so you can add the other hosts to the backup system for centralized management and if you need to perform V2V migration, just select the OpenStack VM backup and then select the target host to restore. Vinchin Virtual Machine Convert Engine will help you automatically convert the virtual machine.

Vinchin Backup & Recovery has been selected by thousands of companies for VM backup and recovery and you can also start to use it with a 60-day full-featured free trial. Just click the button to get the installation package.

Sum Up

OpenStack is a popular cloud computing platform and IT administrators can follow this post to export and import image or instance to make VM backup or perform VM migration.

Of course, you can upgrade manual data import and export solution with the professional system Vinchin Backup & Recovery to better protect and manage OpenStack VMs. Don’t miss the free trial.

Share on:

Categories: VM Backup