in Linux

Proxmox Zfs Send and Recieve

Zfs

Z File System or zfs originaly developed by Sun before ported to FreeBSD and to Linux. Combining traditional file system and logical volume manager. However zfs license under Common development and distribution licences (CDDL) is different from GNU licenses that way zfs not included in the Linux kernel.

Zfs is an advance file system with some interesting features;

  • Pooled storage
  • Copy-on-write
  • Snapshot
  • Data integrity verification and automatic repair
  • RAID-Z capability
  • Maximum 16 extabyte file size
  • Maximum 256 Quadrillion zettabytes storage

By default, Proxmox installation comes with the ZFS file system. So we can utilize some features like snapshoot, send and receive, raid without any extra application.For this post, i will show how we use the zfs send and receive to migrate vm between proxmox nodes.

Zfs send/recieve betwen Proxmox

Firstly you need at least 1 proxmox hypervisor running with zfs file system configured.

  • Create a snapshot from the vm disk for initial send from the first node or source node
    “` zfs send -vnc rpool/data/vm-121-disk-1@snap1“`
  • Send the snapshot to node target with pv command to limit the sending server . The time command is used to check how long the transfer
    “`# time zfs send -vc rpool/data/vm-121-disk-1@snap1 | pv -q -L 25M | ssh proxmox2 zfs recv -s rpool/data/vm-121-disk-1“`
  • Shut down the vm to make sure all the data integrity then create the second snapshot for final migration
    “`# zfs send -vnc rpool/data/vm-121-disk-1@snap2“`
  • Perform the final migration.# time zfs send -v -i rpool/data/vm-121-disk-1@snap1 rpool/data/vm-121-disk-1@snap2 | pv -q -L 25M | ssh proxmox2 zfs recv -v rpool/data/vm-121-disk-1
  • Moved the vm config to the new node

Hope this help.