]> git.proxmox.com Git - pve-container.git/blobdiff - src/PVE/LXC/Migrate.pm
migrate: enforce that rootdir content type is available
[pve-container.git] / src / PVE / LXC / Migrate.pm
index 1e5cb1e924b00e288af885bcef2729c8aa2866da..3cd895da50bdee46d56eb50413f4855976e8a8c9 100644 (file)
@@ -66,6 +66,8 @@ sub prepare {
        my $scfg = PVE::Storage::storage_check_enabled($self->{storecfg}, $storage);
        PVE::Storage::storage_check_enabled($self->{storecfg}, $storage, $self->{node});
 
+       die "content type 'rootdir' is not available on storage '$storage'\n"
+           if !$scfg->{content}->{rootdir};
 
        if ($scfg->{shared}) {
            # PVE::Storage::activate_storage checks this for non-shared storages
@@ -187,13 +189,16 @@ sub phase1 {
        next if !PVE::Storage::storage_check_enabled($self->{storecfg}, $storeid, undef, 1);
 
        # get list from PVE::Storage (for unreferenced volumes)
-       my $dl = PVE::Storage::vdisk_list($self->{storecfg}, $storeid, $vmid);
+       my $dl = PVE::Storage::vdisk_list($self->{storecfg}, $storeid, $vmid, undef, 'rootdir');
 
        next if @{$dl->{$storeid}} == 0;
 
        # check if storage is available on target node
        PVE::Storage::storage_check_enabled($self->{storecfg}, $storeid, $self->{node});
 
+       die "content type 'rootdir' is not available on storage '$storeid'\n"
+           if !$scfg->{content}->{rootdir};
+
        PVE::Storage::foreach_volid($dl, sub {
            my ($volid, $sid, $volname) = @_;