Clone ZFS disk to another vm

wifi75

Well-Known Member
Nov 11, 2019
71
4
48
46
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
 

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!