Sample Header Ad - 728x90

What happens if I run a VM while copying the qcow2 file / can I backup by copying the VM file while running?

2 votes
1 answer
2307 views
I'm trying to understand how the write happens with a VM. It looks like running one is not blocked while copying it for a backup. Will the copy contain any modified files like the boot log? Or will it just copy from a 'shadow copy' like on Windows? The reverse question could be asked, as in, what happens if I start copying while a VM is open. I would guess the mechanics are similar. Would it change the copied file if changes are made during the copy process? My current guess is that only if files are changed that havent been copied yet. I've tested a VM copied this way and it had no noticeable brokenness, but I can image if a file is changed that relies on another file that is already copied to be different to operate, then it could break things. So corollary question is, are there files such as this that change during while the VM is running but not being actively used? I might assume running apt upgrade would be a bad idea, but I'm wondering if I can make a backup with little to no risk, while the VM is just open and running idle. I'm using virt-manager, but I would guess the answers depend more on the image file type qcow2 versus raw more than the VM host software. I'm also wondering if qcow2 has advantages or disadvantages versus a raw image in this regard.
Asked by alchemy (757 rep)
Mar 31, 2022, 11:38 PM
Last activity: Aug 12, 2022, 06:40 AM