The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/8193

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Allows for migration of instances who have snapshots with invalid devices.

Fixes #8187

Signed-off-by: Thomas Parrott <thomas.parr...@canonical.com>
From 3b3590cfab36b727ec2d63e72308c8295d7254f2 Mon Sep 17 00:00:00 2001
From: Thomas Parrott <thomas.parr...@canonical.com>
Date: Thu, 26 Nov 2020 14:44:04 +0000
Subject: [PATCH] lxd/device/disk: Only validate disk source pool when an
 actual instance is set

Allows for migration of instances who have snapshots with invalid devices.

Fixes #8187

Signed-off-by: Thomas Parrott <thomas.parr...@canonical.com>
---
 lxd/device/disk.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lxd/device/disk.go b/lxd/device/disk.go
index da29808a40..8c405aecbc 100644
--- a/lxd/device/disk.go
+++ b/lxd/device/disk.go
@@ -170,7 +170,7 @@ func (d *disk) validateConfig(instConf 
instance.ConfigReader) error {
 
                // Only perform expensive instance custom volume checks when 
not validating a profile and after
                // device expansion has occurred (to avoid doing it twice 
during instance load).
-               if instConf.Type() != instancetype.Any && 
len(instConf.ExpandedDevices()) > 0 && d.config["source"] != "" && 
d.config["path"] != "/" {
+               if d.inst != nil && len(instConf.ExpandedDevices()) > 0 && 
d.config["source"] != "" && d.config["path"] != "/" {
                        poolID, err := 
d.state.Cluster.GetStoragePoolID(d.config["pool"])
                        if err != nil {
                                return fmt.Errorf("The %q storage pool doesn't 
exist", d.config["pool"])
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to