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)
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-0.12.1.2-2.355.e16_4_4.1.x86_64.rpm. I found a great article on http://www.nux.ro/archive/2014/01/Taking_KVM_volume_snapshots_with_Cloudstack_4_2_on_CentOS_6_5.html
I had to install wget by:
yum install wget
rpm2cpio qemu-img-0.12.1.2-2.355.el6_4_4.1.x86_64.rpm |cpio -idmv
cp ./usr/bin/qemu-img /usr/bin/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.