How to enable Snapshot with KVM on CloudStack

If you have chosen KVM as your hypervisor in CloudStack then you probably know that Snapshot is not supported by KVM, only VMware and XenServer. This is refering to Snapshots which capture state of the machine much like a VMware Snapshot.

What is supported is Volume Snapshot which is basically a snapshot of individual volumes. A copy of your volume is backed up to secondary storage. It does have some limitations of course, you can not just roll back to this backup.

But before you can use Volume Snapshot you will have to do a couple of things.

Logon to CloudStack and from Global settings select kvm.snapshot.enabled set it to true and restart the management server (kvm.snapshot.enabled = true)

Enable Snapshot with KVM on CloudStack

This alone won’t do it. Because i am running CentOS 6.6 i have to install an older version of qemu-img, qemu-img- I found a great article on

I had to install wget by:
yum install wget

yum install wget

mkdir cloud-qemu-img
cd cloud-qemu-img
rpm2cpio qemu-img- |cpio -idmv
cp ./usr/bin/qemu-img /usr/bin/cloud-qemu-img

mkdir cloud-qemu-img
Once you have copied down the older version of qemu-img to all your KVM nodes you might want to tweak a few of the Snapshot settings available within the CloudStack console. In Global Settings throttle the number of volume snapshots on each host by modifying the global setting: concurrent.snapshots.threshold.perhost. You can also set snapshot timeout periods and maximum number of snapshots per account, per project or limit snapshots by the hour, day, week or month.

Limiting snapshot settings will enable you to manage your secondary storage usage and help with performance of your storage as running multiple snapshots concurrently have cause performance problems on your storage arrays.

You might also want to set job.expire.minutes so jobs wont stayed queued and will error out.




2 thoughts on “Enable Snapshot with KVM on CloudStack

  1. Thank you, but what can I do with KVM snapshots? I tried to define them as a new ROOT disk for a new instance to restore previous VM state in a new VM, but there seems to be no option in Cloudstack to do that, or am I missing something? New volumes from snapshots appear as DATA disks and not ROOT disks. I understand that there is no roll back functionality in CS and I have read that you can only create a clone of a VM which will have a different MAC and a new IP address and possibly a new hostname.. I am using CS 4.5 and can’t find even how to use at least this cloning option..

  2. I think I got it now, you have to create snapshot of the volume and then from it create template and then new instance..

Comments are closed.