Migrate from local btrfs to local btrfs does not work

Serverhamster

Active Member
Nov 5, 2017
25
3
43
43
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.
 

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!