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.gruenbich...@proxmox.com>
Signed-off-by: Fabian Ebner <f.eb...@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



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to