March 27, 201610 yr Due to a recent snafu of a VM w/ W10, I have determined that I need to start performing daily backups of my vdisk1.img file to another drive. So, the question is....what are others doing? What script or services are people using?
March 27, 201610 yr I use Acronis from within my VM to backup to a network location. Then I just load an Acronis recovery CD in the VM and restore from the image I created. I'm using Windows 7 but it should work with Windows 10 as long as it is a compatible version of Acronis.
March 28, 201610 yr Due to a recent snafu of a VM w/ W10, I have determined that I need to start performing daily backups of my vdisk1.img file to another drive. So, the question is....what are others doing? What script or services are people using? Well there are two methods I guess. You can either backup the VM OS like it was any other computer or you can backup the vdisk1.img itself. Either way I think the standard tools are still applicable. http://lime-technology.com/forum/index.php?topic=47651.msg456651#msg456651 I prefer backing up the VM at KVM File level then you don't have to try and "restore" an OS from within a VM, which can be tricky. Referencing the above link though, I for instance have skipped between two methods. Managed from a Windows machine had SyncBack backup the KVM disk VM Files, meaning I can easily restore the VM within unRAID. You could use Rsync for this within unRAID OR Crashplan Docker etc etc
March 28, 201610 yr Author I don't quite understand why you would need to backup anything but the vdisk1.img file. It seems to me that the W10.iso file and the virtio-win.iso drivers file never change. Isn't the vdisk1.img the only file that holds any changed data like installed apps, W10 registry, etc.? Seems like recovery would be just as simple as replacing the corrupted vdisk1.img file with the backup copy from the day before. Or, am I missing something?
March 28, 201610 yr I don't quite understand why you would need to backup anything but the vdisk1.img file. It seems to me that the W10.iso file and the virtio-win.iso drivers file never change. Isn't the vdisk1.img the only file that holds any changed data like installed apps, W10 registry, etc.? Seems like recovery would be just as simple as replacing the corrupted vdisk1.img file with the backup copy from the day before. Or, am I missing something? Perhaps you're right. I tend to backup everything. Overkill.
March 28, 201610 yr I don't quite understand why you would need to backup anything but the vdisk1.img file. It seems to me that the W10.iso file and the virtio-win.iso drivers file never change. Isn't the vdisk1.img the only file that holds any changed data like installed apps, W10 registry, etc.? Seems like recovery would be just as simple as replacing the corrupted vdisk1.img file with the backup copy from the day before. Or, am I missing something? If you use a "live" imaging program you can backup from within the VM while it's running. If you want to simply backup the vdisk1.img file the VM has to be shut down while you copy the file. As long as you do that, then you're correct -- you can simply copy the virtual disk file back to "restore" it. Which is more convenient depends on your usage pattern for the VM.
March 28, 201610 yr I don't quite understand why you would need to backup anything but the vdisk1.img file. It seems to me that the W10.iso file and the virtio-win.iso drivers file never change. Isn't the vdisk1.img the only file that holds any changed data like installed apps, W10 registry, etc.? Seems like recovery would be just as simple as replacing the corrupted vdisk1.img file with the backup copy from the day before. Or, am I missing something? If you use a "live" imaging program you can backup from within the VM while it's running. If you want to simply backup the vdisk1.img file the VM has to be shut down while you copy the file. As long as you do that, then you're correct -- you can simply copy the virtual disk file back to "restore" it. Which is more convenient depends on your usage pattern for the VM. That is why I use Acronis from within the VM. My VMs are recording servers and doing it this way I can make an image backup while it is busy recording something. The only time I have to shutdown the VM is if I want to restore it completely - like the VM was a bare metal restore.
March 29, 201610 yr If you want to simply backup the vdisk1.img file the VM has to be shut down while you copy the file. As long as you do that, then you're correct -- you can simply copy the virtual disk file back to "restore" it. Is there a way to shut down / restart a [Win7] VM with a script like you can a docker container? That would allow us to back up the vdisk using cron. I use Acronis, too, but I'm a belts-and-suspenders guy like danioj.
March 29, 201610 yr Is there a way to shut down / restart a [Win7] VM with a script like you can a docker container? Sure. Google virsh command options.
March 29, 201610 yr If you want to simply backup the vdisk1.img file the VM has to be shut down while you copy the file. As long as you do that, then you're correct -- you can simply copy the virtual disk file back to "restore" it. Is there a way to shut down / restart a [Win7] VM with a script like you can a docker container? That would allow us to back up the vdisk using cron. I use Acronis, too, but I'm a belts-and-suspenders guy like danioj. I will use my ubuntu virtual machine running on my server in these examples. First list virtual machines that are running, type the following command: root@main:~# virsh list You will get an output similar to my output: root@main:~# virsh list Id Name State ---------------------------------------------------- 1 ubuntu-vm-main running 2 windows-vm-main running clean shutdown a guest virtual machine, type one of the following commands: root@main:~# virsh shutdown ubuntu-vm-main root@main:~# virsh 1 You will get an output similar to my output: root@main:~# virsh shutdown ubuntu-vm-main Domain ubuntu-vm-main is being shutdown root@main:~# OR restart a guest virtual machine, type one of the following commands: virsh reboot ubuntu-vm-main virsh reboot 1 You will get an output similar to my output: root@main:~# virsh reboot ubuntu-vm-main Domain ubuntu-vm-main is being rebooted root@main:~# OR force shutdown a guest, type one of the following commands: virsh destroy ubuntu-vm-main virsh destroy 1 You will get an output similar to my output: root@main:~# virsh destroy ubuntu-vm-main Domain ubuntu-vm-main destroyed root@main:~# Hope this helps.
March 29, 201610 yr I'm using Macrium Reflect free from within my windows 10 VM, it has worked great for multiple restores. I do wish unraid had a built in method of backing up the .img file, maybe that will be added sometime?
March 29, 201610 yr Nice post Daniel => those commands provide everything that would be needed to create a simple script to backup a VM. e.g. (a) shut it down; (b) copy the virtual disk; and © restart the VM One question: What happens if you invoke the shutdown command and the VM isn't currently running? [i.e. would this cause a script that started with that command to fail?]
March 30, 201610 yr Nice post Daniel => those commands provide everything that would be needed to create a simple script to backup a VM. e.g. (a) shut it down; (b) copy the virtual disk; and © restart the VM One question: What happens if you invoke the shutdown command and the VM isn't currently running? [i.e. would this cause a script that started with that command to fail?] It throws an error. I destroyed a Virtual Machine on my server and then tried to shut it down. This is an example of the output: root@main:~# virsh destroy ubuntu-vm-main Domain ubuntu-vm-main destroyed root@main:~# virsh shutdown ubuntu-vm-main error: Failed to shutdown domain ubuntu-vm-main error: Requested operation is not valid: domain is not running root@main:~# You inspired me to do something : http://lime-technology.com/forum/index.php?topic=47986
Archived
This topic is now archived and is closed to further replies.