[lxc-devel] [lxd/master] lxd/device/disk: Prevents error logs about unsupported disk drive on VM stop

tomponline on Github lxc-bot at linuxcontainers.org
Fri Nov 22 17:27:10 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 361 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20191122/313eb5d9/attachment.bin>
-------------- next part --------------
From b8f7aed8d3723b2f155ae1412008ca99472a7a50 Mon Sep 17 00:00:00 2001
From: Thomas Parrott <thomas.parrott at canonical.com>
Date: Fri, 22 Nov 2019 17:26:27 +0000
Subject: [PATCH] lxd/device/disk: Prevents error logs about unsupported disk
 drive on VM stop

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

diff --git a/lxd/device/disk.go b/lxd/device/disk.go
index 5641567cf2..1f10f2055c 100644
--- a/lxd/device/disk.go
+++ b/lxd/device/disk.go
@@ -736,7 +736,8 @@ func (d *disk) createDevice() (string, error) {
 // Stop is run when the device is removed from the instance.
 func (d *disk) Stop() (*deviceConfig.RunConfig, error) {
 	if d.instance.Type() == instancetype.VM {
-		if shared.IsRootDiskDevice(d.config) {
+		// Only root disks and cloud-init:config drives supported on VMs.
+		if shared.IsRootDiskDevice(d.config) || d.config["source"] == diskSourceCloudInit {
 			return &deviceConfig.RunConfig{}, nil
 		}
 


More information about the lxc-devel mailing list