[lxc-devel] [lxd/master] lxd/storage/drivers/driver/ceph/volume: Don't format block volumes with a filesystem

tomponline on Github lxc-bot at linuxcontainers.org
Fri Feb 28 14:19:08 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 365 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20200228/fbc3d44f/attachment.bin>
-------------- next part --------------
From 8e635ed1aed9d97676e9e681ef0a743a56114af5 Mon Sep 17 00:00:00 2001
From: Thomas Parrott <thomas.parrott at canonical.com>
Date: Fri, 28 Feb 2020 14:18:12 +0000
Subject: [PATCH] lxd/storage/drivers/driver/ceph/volume: Don't format block
 volumes with a filesystem

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

diff --git a/lxd/storage/drivers/driver_ceph_volumes.go b/lxd/storage/drivers/driver_ceph_volumes.go
index ba38908fb2..cd1f1581a7 100644
--- a/lxd/storage/drivers/driver_ceph_volumes.go
+++ b/lxd/storage/drivers/driver_ceph_volumes.go
@@ -102,9 +102,12 @@ func (d *ceph) CreateVolume(vol Volume, filler *VolumeFiller, op *operations.Ope
 
 	// Get filesystem.
 	RBDFilesystem := d.getRBDFilesystem(vol)
-	_, err = makeFSType(RBDDevPath, RBDFilesystem, nil)
-	if err != nil {
-		return err
+
+	if vol.contentType == ContentTypeFS {
+		_, err = makeFSType(RBDDevPath, RBDFilesystem, nil)
+		if err != nil {
+			return err
+		}
 	}
 
 	// For VMs, also create the filesystem volume.


More information about the lxc-devel mailing list