allow migrating raw btrfs volumes

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2021-06-22 14:18:28 +02:00 committed by Thomas Lamprecht
parent a799cf5b64
commit 205dbf39b1

View File

@ -509,7 +509,10 @@ sub scan_local_volumes {
# exceptions: 'zfspool' or 'qcow2' files (on directory storage) # exceptions: 'zfspool' or 'qcow2' files (on directory storage)
die "online storage migration not possible if snapshot exists\n" if $self->{running}; die "online storage migration not possible if snapshot exists\n" if $self->{running};
if (!($scfg->{type} eq 'zfspool' || $local_volumes->{$volid}->{format} eq 'qcow2')) { if (!($scfg->{type} eq 'zfspool'
|| ($scfg->{type} eq 'btrfs' && $local_volumes->{$volid}->{format} eq 'raw')
|| $local_volumes->{$volid}->{format} eq 'qcow2'
)) {
die "non-migratable snapshot exists\n"; die "non-migratable snapshot exists\n";
} }
} }
@ -560,7 +563,7 @@ sub scan_local_volumes {
my ($sid, $volname) = PVE::Storage::parse_volume_id($volid); my ($sid, $volname) = PVE::Storage::parse_volume_id($volid);
my $scfg = PVE::Storage::storage_config($storecfg, $sid); my $scfg = PVE::Storage::storage_config($storecfg, $sid);
my $migratable = $scfg->{type} =~ /^(?:dir|zfspool|lvmthin|lvm)$/; my $migratable = $scfg->{type} =~ /^(?:dir|btrfs|zfspool|lvmthin|lvm)$/;
die "can't migrate '$volid' - storage type '$scfg->{type}' not supported\n" die "can't migrate '$volid' - storage type '$scfg->{type}' not supported\n"
if !$migratable; if !$migratable;