Does anyone has such experience that you accidentally delete the used disk image when virtual machine is running?
I would expect that the virtual machine will fail immediate, but, surprisingly, it still running perfectly. I have tried to execute many I/O commands and even create very large files by “dd” which are totally more larger then the vm’s memory size. But it is still live.
Can anyone explain why?
ubuntu 12.04 with KVM and libvirt installed from default repo.
VM’s disk image is qcow2 format.
Deleting a file does not actually delete the file, it reduces the number of names pointing to an inode. If both the number of names and the number of open file descriptors to the file reach 0, the data gets deleted.
So if you delete a file that’s still open by some application, that application can still happily use that file. Only when the last file descriptor gets closed, the file gets deleted (and then you’ll see the used space is reclaimed again).
Source : Link , Question Author : user1817188 , Answer Author : arjarj