When there is a bunch of running instances, you would want to make sure to keep backups of your precious data.
There are a lot of backup solutions out there, but it is preferable to use a very simple script that can be configured as a daily cronjob
on the OpenNebula frontend to create a new snapshot for each attached EBS volume and keep at most six backup copies of them, deleting the older ones.
#!/bin/bash COUNT_TO_KEEP=6 VOLUME_LIST=$(ec2-describe-volumes | grep ATTACHMENT | awk {'print $2'}) for VOLUME in $(echo $VOLUME_LIST); do echo ">>> Searching $VOLUME snapshots to remove" ec2-describe-snapshots | grep Autobackup | grep $VOLUME | sort -r -k 5 | sed 1,${COUNT_TO_KEEP}d | awk '{print ">>> Deleting snapshot: " $2}; system("ec2-delete-snapshot " $2)' echo ">>> Create a new snapshot for $VOLUME" ec2-create-snapshot -d Autobackup_$VOLUME $VOLUME done
It will not delete the snapshots generated without this script which is marked...