Skip to content

Instantly share code, notes, and snippets.

@ajayhn
Created March 27, 2015 02:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajayhn/6455c280e8c49ad57614 to your computer and use it in GitHub Desktop.
Save ajayhn/6455c280e8c49ad57614 to your computer and use it in GitHub Desktop.
openstack-create-qcow2-snapshot
In this example, an instance was launched with flavor 80G. installation didn't consume much of the disk. When snapshot was created without below steps its size was 80G (since openstack has raw in _base and snapshot creates with that raw size). By doing below (pull ing from _base to disk, qcow2 without the raw backing file reduces size of snapshot).
root@a6s15:/var/lib/nova/instances/ed719037-2e00-4c4c-90f9-924578f93b80# qemu-img info disk
image: disk
file format: qcow2
virtual size: 80G (85899345920 bytes)
disk size: 77M
cluster_size: 65536
** backing file: /var/lib/nova/instances/_base/1d043087def843d5e081c1e2c3ea6ca1e4278547 **
Format specific information:
compat: 1.1
lazy refcounts: false
root@a6s15:/var/lib/nova/instances/ed719037-2e00-4c4c-90f9-924578f93b80# virsh blockpull instance-00000140 vda --verbose --wait
Block Pull: [100 %]
Pull complete
root@a6s15:/var/lib/nova/instances/ed719037-2e00-4c4c-90f9-924578f93b80# qemu-img info disk
image: disk
file format: qcow2
virtual size: 80G (85899345920 bytes)
disk size: 3.1G
cluster_size: 65536
Format specific information:
compat: 1.1
lazy refcounts: false
Now you can create snapshot using openstack API and created snapshot will be small in size.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment