Clone ZFS disk to another vm

wifi75

Well-Known Member
Nov 11, 2019
71
4
48
47
Hello I want to clone ZFS disk vm-104-disk-0 to Vm-101-disk-0,
how I can?
this is my zfs list:
1667991924064.png
 
Last edited:
PVE allows you to clone VMs from within the UI.
Cloning disks involves CLI operations.

Step 1: clone the content of the disk
Step 2: edit the corresponding PVE-VM config in /etc/pve/qemu-server

Step 1 I thought is outlined in the provided link, but I was wrong.
The concept of a "clone" was different to my understanding.

First you need to create a snapshot of the disk. Best to shutdown your other VM to get a clean state.
After that
Code:
zfs send rpool/data/vm-104-disk-0 | zfs receive rpool/data/vm-101-disk-0

if that for whatever reason does not work you need to create a snapshot first.
Code:
zfs snapshot rpool/data/vm-104-disk-0@now
zfs list -t snapshot
After that create the clone:
Code:
zfs send rpool/data/vm-104-disk-0@now | zfs receive rpool/data/vm-101-disk-0
After that you will see a new dataset via
Code:
zfs list

Dont forget to clean up the snapshot via
Code:
zfs destroy rpool/data/vm-104-disk-0@now

Commands provided for own convenience.
Use at own risk
No liabilities taken