[pve-devel] [PATCH v2 storage 1/5] fix #3030: always activate volumes in storage_migrate

Fabian Ebner f.ebner at proxmox.com
Fri Nov 6 15:30:55 CET 2020


AFAICT the snapshot activation is not necessary for our plugins at the moment,
but it doesn't really hurt and might be relevant in the future or for external
plugins.

Deactivating volumes is up to the caller, because for example, for replication
on a running guest, we obviously don't want to deactivate volumes.

Suggested-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---
 PVE/Storage.pm | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/PVE/Storage.pm b/PVE/Storage.pm
index cd7b5ff..69c373b 100755
--- a/PVE/Storage.pm
+++ b/PVE/Storage.pm
@@ -697,6 +697,13 @@ sub storage_migrate {
     };
 
     volume_snapshot($cfg, $volid, $snapshot) if $migration_snapshot;
+
+    if (defined($snapshot)) {
+	activate_volumes($cfg, [$volid], $snapshot);
+    } else {
+	activate_volumes($cfg, [$volid]);
+    }
+
     eval {
 	if ($insecure) {
 	    my $input = IO::File->new();
-- 
2.20.1






More information about the pve-devel mailing list