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

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) ===
Signed-off-by: Stéphane Graber <[email protected]>
From d6c693be5a5ad0baae947c0590f40e4f1312c32b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <[email protected]>
Date: Tue, 7 May 2019 14:37:26 -0400
Subject: [PATCH] lxd/storage/ceph: Only rewrite UUID once
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <[email protected]>
---
 lxd/storage_ceph.go       | 6 ------
 lxd/storage_ceph_utils.go | 7 +++++++
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/lxd/storage_ceph.go b/lxd/storage_ceph.go
index 61563d3aa8..f90c9ba304 100644
--- a/lxd/storage_ceph.go
+++ b/lxd/storage_ceph.go
@@ -1159,12 +1159,6 @@ func (s *storageCeph) ContainerCopy(target container, 
source container,
                        return err
                }
 
-               // Re-generate the UUID
-               err := s.cephRBDGenerateUUID(projectPrefix(target.Project(), 
target.Name()), storagePoolVolumeTypeNameContainer)
-               if err != nil {
-                       return err
-               }
-
                logger.Debugf(`Copied RBD container storage %s to %s`,
                        sourceContainerName, target.Name())
                return nil
diff --git a/lxd/storage_ceph_utils.go b/lxd/storage_ceph_utils.go
index abe9bdc4af..4f6889af9b 100644
--- a/lxd/storage_ceph_utils.go
+++ b/lxd/storage_ceph_utils.go
@@ -740,6 +740,13 @@ func (s *storageCeph) copyWithoutSnapshotsFull(target 
container,
                return err
        }
 
+       // Re-generate the UUID
+       err = s.cephRBDGenerateUUID(projectPrefix(target.Project(), 
target.Name()), storagePoolVolumeTypeNameContainer)
+       if err != nil {
+               return err
+       }
+
+       // Create mountpoint
        targetContainerMountPoint := getContainerMountPoint(target.Project(), 
s.pool.Name, target.Name())
        err = createContainerMountpoint(targetContainerMountPoint, 
target.Path(), target.IsPrivileged())
        if err != nil {
_______________________________________________
lxc-devel mailing list
[email protected]
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to