Migrate from local btrfs to local btrfs does not work

Serverhamster

Active Member
Nov 5, 2017
25
4
43
44
I'm trying to migrate a VM from a local btrfs storage to another server with local btrfs storage.
Code:
2022-03-23 21:25:40 starting migration of VM 504 to node 'r2d2' (192.168.80.6)
2022-03-23 21:25:40 found local disk 'local-btrfs-sanstor:504/vm-504-disk-0.raw' (in current VM config)
2022-03-23 21:25:40 copying local disk images
2022-03-23 21:26:31 btrfs error: ERROR: cannot flip ro->rw with received_uuid set, use force if you really want that
send/receive failed, cleaning up snapshot(s)..
2022-03-23 21:26:32 ERROR: storage migration for 'local-btrfs-sanstor:504/vm-504-disk-0.raw' to storage 'local-btrfs-sanstor' failed - command 'set -o pipefail && pvesm export local-btrfs-sanstor:504/vm-504-disk-0.raw btrfs - -with-snapshots 0 -snapshot __migration__ | /usr/bin/ssh -e none -o 'BatchMode=yes' -o 'HostKeyAlias=r2d2' root@192.168.80.6 -- pvesm import local-btrfs-sanstor:504/vm-504-disk-0.raw btrfs - -with-snapshots 0 -snapshot __migration__ -delete-snapshot __migration__ -allow-rename 1' failed: exit code 2
2022-03-23 21:26:32 aborting phase 1 - cleanup resources
2022-03-23 21:26:32 ERROR: migration aborted (duration 00:00:53): storage migration for 'local-btrfs-sanstor:504/vm-504-disk-0.raw' to storage 'local-btrfs-sanstor' failed - command 'set -o pipefail && pvesm export local-btrfs-sanstor:504/vm-504-disk-0.raw btrfs - -with-snapshots 0 -snapshot __migration__ | /usr/bin/ssh -e none -o 'BatchMode=yes' -o 'HostKeyAlias=r2d2' root@192.168.80.6 -- pvesm import local-btrfs-sanstor:504/vm-504-disk-0.raw btrfs - -with-snapshots 0 -snapshot __migration__ -delete-snapshot __migration__ -allow-rename 1' failed: exit code 2
TASK ERROR: migration aborted
It looks like the error cannot flip ro->rw with received_uuid set comes from btrfs-clone. I retried after upgrading to kernel 5.15, but the result is the same.
 
seems like that got broken with the recent btrfs-progs update, and we need to handle this..
 
  • Like
Reactions: Serverhamster
yeah, live migration happens within qemu, not on the storage level.
 
i must delete snapshot ,then offline migration success
Code:
2022-05-16 10:29:52 starting migration of VM 101 to node 'pve02' (192.168.93.201)
2022-05-16 10:29:52 found local disk 'local-btrfs:101/vm-101-disk-0.raw' (in current VM config)
2022-05-16 10:29:52 copying local disk images
2022-05-16 10:37:28 15728640+0 records in
2022-05-16 10:37:28 15728640+0 records out
2022-05-16 10:37:28 64424509440 bytes (64 GB, 60 GiB) copied, 453.608 s, 142 MB/s
2022-05-16 10:37:28 82500+3238506 records in
2022-05-16 10:37:28 82500+3238506 records out
2022-05-16 10:37:28 successfully imported 'local-btrfs:101/vm-101-disk-0.raw'
2022-05-16 10:37:28 64424509440 bytes (64 GB, 60 GiB) copied, 453.64 s, 142 MB/s
2022-05-16 10:37:28 volume 'local-btrfs:101/vm-101-disk-0.raw' is 'local-btrfs:101/vm-101-disk-0.raw' on the target
2022-05-16 10:37:31 migration finished successfully (duration 00:07:39)
TASK OK
 
Fabian,
It has been almost a year... Any progress with correcting this issue? I read that live migration is a work-around but this is problematic when there are issues with starting a VM that has other problems that I'm trying to isolate.
 
Hi - I stumbled upon this issue as well when trying to migrate a VM template from one to the other PVE cluster nodes.

Do we have an issue for that?
 
Is there a fix? I'm on the latest Proxmox Version trying to migrate from BTRFS to BTRFS (local) and it fails:

Code:
root@pve-01-numenor:~# qm migrate 200 pve-02-valinor --with-local-disks --online
2025-04-06 00:04:35 starting migration of VM 200 to node 'pve-02-valinor' (10.0.0.15)
2025-04-06 00:04:35 found generated disk 'local-btrfs:200/vm-200-cloudinit.qcow2' (in current VM config)
2025-04-06 00:04:35 found local disk 'local-btrfs:200/vm-200-disk-0.raw' (attached)
2025-04-06 00:04:35 copying local disk images
2025-04-06 00:04:35 ERROR: storage migration for 'local-btrfs:200/vm-200-cloudinit.qcow2' to storage 'local-btrfs' failed - cannot migrate from storage type 'btrfs' to 'btrfs'
2025-04-06 00:04:35 aborting phase 1 - cleanup resources
2025-04-06 00:04:35 ERROR: migration aborted (duration 00:00:01): storage migration for 'local-btrfs:200/vm-200-cloudinit.qcow2' to storage 'local-btrfs' failed - cannot migrate from storage type 'btrfs' to 'btrfs'
migration aborted

Which local storage type does support live migration right now? Currently I habe no setup that would be appropriate for distributed storage.
 
almost all of them do.. could you post "pveversion -v" and "qm config 200"?