[lxc-devel] [lxd/master] lxd/storage/backend/lxd: CreateInstanceFromMigration comments

tomponline on Github lxc-bot at linuxcontainers.org
Tue Dec 3 14:02:43 UTC 2019


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 414 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20191203/aaae2ec9/attachment.bin>
-------------- next part --------------
From 61ee872fa7a0d6d7842a0d7e78ea1e9e29f9db79 Mon Sep 17 00:00:00 2001
From: Thomas Parrott <thomas.parrott at canonical.com>
Date: Tue, 3 Dec 2019 13:52:58 +0000
Subject: [PATCH] lxd/storage/backend/lxd: CreateInstanceFromMigration comments

Signed-off-by: Thomas Parrott <thomas.parrott at canonical.com>
---
 lxd/storage/backend_lxd.go | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lxd/storage/backend_lxd.go b/lxd/storage/backend_lxd.go
index 511f0d9a96..99b2c17243 100644
--- a/lxd/storage/backend_lxd.go
+++ b/lxd/storage/backend_lxd.go
@@ -846,9 +846,13 @@ func (b *lxdBackend) CreateInstanceFromMigration(inst instance.Instance, conn io
 		}()
 
 		// If the negotiated migration method is rsync and the instance's base image is
-		// already on the host then pre-create the instance's volume using the locla image
-		// to try and speed up the rsync of the incoming volume by avoiding the new to
+		// already on the host then pre-create the instance's volume using the local image
+		// to try and speed up the rsync of the incoming volume by avoiding the need to
 		// transfer the base image files too.
+		// This is performed in the backendLXD rather than the driver because the driver
+		// should not have access to the database and we need to do an image record lookup
+		// in order to perform this optimisation when using storage drivers that do not
+		// managed their own volumes (such as directory).
 		if args.MigrationType.FSType == migration.MigrationFSType_RSYNC {
 			fingerprint := inst.ExpandedConfig()["volatile.base_image"]
 			_, _, err = b.state.Cluster.ImageGet(inst.Project(), fingerprint, false, true)


More information about the lxc-devel mailing list