Running VM clonning question

iwik

Member
Oct 7, 2021
51
9
13
43
I would like to ask how clonning running VM with multiple disks works. Is it like in vmware where when you start clone, all disks are snapshothed so all disks are from same point of time or each disk is from different time, as it was processed - in clone job?

Running on ZFS and from job output i am not sure now...
 
PVE does not automatically create a STORAGE snapshot of a disk for a clone operation.
Only full clones can be made from a regular virtual machine (VM). However, the source can be an existing snapshot of the VM.
  • From a Snapshot: When the source is a snapshot, consistency across all disks is generally ensured.
  • From a Live VM: When cloning from a LIVE VM PVE uses QEMU disk mirror functionality. It mirrors all disks sequentially but does not disconnect the mirror until all disks are done.
  • When all disks are copied two things can happen:
    • a) Guest agent is asked to freeze filesystems , disk mirror is broken, allowing the data to be synced up across all disks to that point
    • b) VM is paused, mirror is broken. This happens if there is no Agent
To answer your questions, the data on disks should be consistent at a time when the mirror is broken, which is coordinated by PVE

Cheers!


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
Last edited:
Sorry, but your answer does not contain root information - are cloned disks from same point of time, when I clone running vm with multiple disks?
I have tried clone from snapshot, but this seem not to be working for ZFS, it gets error 500 (not supported for current disk).
I have mysql database and I need to setup slave. I have done flush tables with read lock, sync, then clone. But this probably ends with inconsistency mess...
 
Do a backup instead of clone is probably solution to my problem.
I've went back to refresh my recollections about VM clone and adjusted my prior answer for correctness and more details.

Cheers

You can test the clone operation as following:
a) Create a VM with two disks
b) Start a loop that writes data to a file on each disk, ie: while true;do date >> /root/date.txt && date >> /mnt/disk2/date.txt && sync;sleep 1;done
c) Execute full clone
d) compare date.txt files.
You should see same context on both and may see a gap from when the VM was paused or filesystems were frozen.


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
I dont think PVE allows this functionality through pveproxy (the gui or api) but I could be wrong. and yes, backup/restore would work.

It is possible to do what you want manually using the storage api, eg zfs/rbd snap and clone.
 
I dont think PVE allows this functionality through pveproxy (the gui or api) but I could be wrong. and yes, backup/restore would work.
I am surprised that OP had issue with ZFS based VM clone. I thought ZFS was versatile enough to be able to handle it. I had no issues cloning VM backed by Blockbridge iSCSI, even though PVE completely abstracts storage snapshots in this case.


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!