Updates to my KVM backup script

I’ve been spending quite a bit of time refining the KVM backup script. I’ve added the ability for the script to snapshot the LVM block device and immediately restart the machine. I was also not able to find a way to get Windows guests to shutdown reliably. The guest will shutdown if a user is logged on, and if no user is logged on, but it will not shut down if a user is logged on and the user has locked the workstation. To workaround this I added the “-w” option to shutdown a windows guest using the “net rpc shutdown” command with samba. Check out the project on github.

Super simple automated image based virsh/kvm backup


Warning: file_get_contents(https://raw.github.com/tstafford/Simple-image-based-kvm-virsh-backup-script/master/doBackup.sh): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/tstafford/public_html/wp-content/plugins/include-file/include-file.php on line 12

At my workplace I use KVM as our primary virtualization solution with LVM volumes for each virtual hard disk. I have created a simple script to perform an image based backup of a guest using dd. This could be improved by setting a snapshot while the guest is down and then immediately bringing it back up, however, I use backuppc for file based backup of the data on each machine. So, I don’t feel the need to perform image based backups often enough that I can’t fit them in a normal maintenance period.

The script is posted below and at github

Update: I’ve changed this post so it will always include the latest version of the script from github

An error occured retreiving https://raw.github.com/tstafford/Simple-image-based-kvm-virsh-backup-script/master/doBackup.sh