When two nodes in a cluster don't have the same storage name, I cannot migrate from one node to the other using Proxmox tools.
For example, I have two nodes on same cluster, both have local ZFS storages, but the ZFS pools are named differently, so the storage has to be named differently too. (one storage is named zfslocal, with zpool "storage", the other, local-zfs, with zpool "rpool")
I tried doing this command:
but it failed:
So instead I found that I can do the migration manually with zfs send/recv, but I wanted to ask you if I am missing any steps.
I should also delete the ZFS dataset in the server I migrated from after I finish, but since I'm going to re-format that node, I don't even waste my time doing that.
For example, I have two nodes on same cluster, both have local ZFS storages, but the ZFS pools are named differently, so the storage has to be named differently too. (one storage is named zfslocal, with zpool "storage", the other, local-zfs, with zpool "rpool")
I tried doing this command:
qm migrate 159 ares --targetstorage local-zfs --online --with-local-disks
but it failed:
2018-12-05 13:46:45 starting migration of VM 159 to node 'ares' (192.168.0.60)
2018-12-05 13:46:45 found local disk 'zfslocal:vm-159-disk-0' (in current VM config)
2018-12-05 13:46:45 copying disk images
full send of storage/vm-159-disk-0@__migration__ estimated size is 1.72G
total estimated size is 1.72G
TIME SENT SNAPSHOT
cannot open 'storage/vm-159-disk-0': dataset does not exist
cannot receive new filesystem stream: dataset does not exist
cannot open 'storage/vm-159-disk-0': dataset does not exist
command 'zfs recv -F -- storage/vm-159-disk-0' failed: exit code 1
command 'zfs send -Rpv -- storage/vm-159-disk-0@__migration__' failed: got signal 13
send/receive failed, cleaning up snapshot(s)..
2018-12-05 13:46:47 ERROR: Failed to sync data - command 'set -o pipefail && pvesm export zfslocal:vm-159-disk-0 zfs - -with-snapshots 0 -snapshot __migration__ | /usr/bin/ssh -e none -o 'BatchMode=yes' -o 'HostKeyAlias=ares' root@192.168.0.60 -- pvesm import zfslocal:vm-159-disk-0 zfs - -with-snapshots 0 -delete-snapshot __migration__' failed: exit code 1
2018-12-05 13:46:47 aborting phase 1 - cleanup resources
2018-12-05 13:46:47 ERROR: found stale volume copy 'zfslocal:vm-159-disk-0' on node 'ares'
2018-12-05 13:46:47 ERROR: migration aborted (duration 00:00:02): Failed to sync data - command 'set -o pipefail && pvesm export zfslocal:vm-159-disk-0 zfs - -with-snapshots 0 -snapshot __migration__ | /usr/bin/ssh -e none -o 'BatchMode=yes' -o 'HostKeyAlias=ares' root@192.168.0.60 -- pvesm import zfslocal:vm-159-disk-0 zfs - -with-snapshots 0 -delete-snapshot __migration__' failed: exit code 1
migration aborted
2018-12-05 13:46:45 found local disk 'zfslocal:vm-159-disk-0' (in current VM config)
2018-12-05 13:46:45 copying disk images
full send of storage/vm-159-disk-0@__migration__ estimated size is 1.72G
total estimated size is 1.72G
TIME SENT SNAPSHOT
cannot open 'storage/vm-159-disk-0': dataset does not exist
cannot receive new filesystem stream: dataset does not exist
cannot open 'storage/vm-159-disk-0': dataset does not exist
command 'zfs recv -F -- storage/vm-159-disk-0' failed: exit code 1
command 'zfs send -Rpv -- storage/vm-159-disk-0@__migration__' failed: got signal 13
send/receive failed, cleaning up snapshot(s)..
2018-12-05 13:46:47 ERROR: Failed to sync data - command 'set -o pipefail && pvesm export zfslocal:vm-159-disk-0 zfs - -with-snapshots 0 -snapshot __migration__ | /usr/bin/ssh -e none -o 'BatchMode=yes' -o 'HostKeyAlias=ares' root@192.168.0.60 -- pvesm import zfslocal:vm-159-disk-0 zfs - -with-snapshots 0 -delete-snapshot __migration__' failed: exit code 1
2018-12-05 13:46:47 aborting phase 1 - cleanup resources
2018-12-05 13:46:47 ERROR: found stale volume copy 'zfslocal:vm-159-disk-0' on node 'ares'
2018-12-05 13:46:47 ERROR: migration aborted (duration 00:00:02): Failed to sync data - command 'set -o pipefail && pvesm export zfslocal:vm-159-disk-0 zfs - -with-snapshots 0 -snapshot __migration__ | /usr/bin/ssh -e none -o 'BatchMode=yes' -o 'HostKeyAlias=ares' root@192.168.0.60 -- pvesm import zfslocal:vm-159-disk-0 zfs - -with-snapshots 0 -delete-snapshot __migration__' failed: exit code 1
migration aborted
So instead I found that I can do the migration manually with zfs send/recv, but I wanted to ask you if I am missing any steps.
- I take the VM offline
- I take a snapshot of the VM through the GUI, named "migration"
- I do a zfs send like this:
- zfs send --replicate --large-block --compressed --verbose storage/subvol-106-disk-0@migration | ssh 192.168.0.60 zfs recv -v rpool/data/subvol-106-disk-0
- I move the config file like this:
- mv /etc/pve/nodes/poseidon/qemu-server/106.conf /etc/pve/nodes/ares/qemu-server/106.conf
- I edit that file and replace all mentions of "zfslocal" with "local-zfs"
I should also delete the ZFS dataset in the server I migrated from after I finish, but since I'm going to re-format that node, I don't even waste my time doing that.