VDI export of running VM
-
What happens when I use
xe vdi-export
on a disk that is attached to a running VM? Does it create a shadow copy to do the export?I'm sure I need to shutdown the VM to do
xe vdi-import
but being able to export live could be very useful. -
Hi,
An export of a live VM is always while using a snapshot. That's how XO is doing backup of a running infrastructure.
You simply can't copy a VDI that is actually used by a VM, because blocks are moving. How could you be sure to copy the entire correct blocks without doing a snapshot? It's simply not possible
-
Thanks for the reply.
I'm still not sure about the process. Does it copy a "snapshot-in-time" version? In other words, if I run
xe vdi-export
am getting a copy of whatever was there, at that moment?I understand that there are serious problems in trying to copy anything that is "live". For example, FSArchiver can be forced to copy a live system and while it does this safely, there may be inconsistencies in the data.
-
I suspect that you would need to create a new snapshot using
xe
and then use the snapshot as the source of the export instead of the running VM. Have you looked into using XO's REST API for this instead ofxe
? -
The VM is aware of being snapshoted, so it's not an issue. Can you explain what do you want to achieve in the end? That would be helpful to assist
-
Thanks for the replies! Sorry, I lost track of this thread.
@olivierlambert said in VDI export of running VM:
The VM is aware of being snapshoted, so it's not an issue. Can you explain what do you want to achieve in the end? That would be helpful to assist
I'm trying to find a way to script VM backups.
One complication is that at least one VM has a data drive that is too big for regular backups. So, I wonder if there's way to work around that.
-
Yes, you can use XO webhooks (IIRC) to trigger something before or after a backup and send the request to a custom agent you made inside the VM.
But I'm not sure to get it, can you provide what do you want to achieve, not the technical solution (script VM backup is already a solution, not the problem you are trying to solve)