[lxc-devel] [lxd/master] Make cephfs storage driver match disk device

stgraber on Github lxc-bot at linuxcontainers.org
Thu Apr 23 19:16:38 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 301 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20200423/b51781b4/attachment.bin>
-------------- next part --------------
From 0ee636be37322770f1ab54c4eafa4674c8f44e60 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Thu, 23 Apr 2020 10:32:52 -0400
Subject: [PATCH 1/2] lxd/instance/qemu: Add comment on cpuTopology
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 lxd/instance/drivers/driver_qemu.go | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lxd/instance/drivers/driver_qemu.go b/lxd/instance/drivers/driver_qemu.go
index 3c3eb28dc2..1d1b7fbce5 100644
--- a/lxd/instance/drivers/driver_qemu.go
+++ b/lxd/instance/drivers/driver_qemu.go
@@ -4291,6 +4291,8 @@ func (vm *qemu) UpdateBackupFile() error {
 	return pool.UpdateInstanceBackupFile(vm, nil)
 }
 
+// cpuTopology takes a user cpu range and returns the number of sockets, cores and threads to configure
+// as well as a map of vcpu to threadid for pinning and a map of numa nodes to vcpus for NUMA layout.
 func (vm *qemu) cpuTopology(limit string) (int, int, int, map[uint64]uint64, map[uint64][]uint64, error) {
 	// Get CPU topology.
 	cpus, err := resources.GetCPU()

From c2592017e081ac5c9d44bd9fcc12fcb87f151e4c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Thu, 23 Apr 2020 15:15:28 -0400
Subject: [PATCH 2/2] lxd/storage/ceph: Support port in URL
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 lxd/storage/drivers/driver_cephfs.go | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/lxd/storage/drivers/driver_cephfs.go b/lxd/storage/drivers/driver_cephfs.go
index 39decb6fdc..11092f4be0 100644
--- a/lxd/storage/drivers/driver_cephfs.go
+++ b/lxd/storage/drivers/driver_cephfs.go
@@ -140,7 +140,12 @@ func (d *cephfs) Create() error {
 	}
 
 	// Mount the pool.
-	uri := fmt.Sprintf("%s:6789:/", strings.Join(monAddresses, ","))
+	uri := strings.Join(monAddresses, ",")
+	if !strings.Contains(uri, ":6789") {
+		uri = fmt.Sprintf("%s:6789", uri)
+	}
+	uri = fmt.Sprintf("%s:/", uri)
+
 	err = TryMount(uri, mountPoint, "ceph", 0, fmt.Sprintf("name=%v,secret=%v,mds_namespace=%v", d.config["cephfs.user.name"], userSecret, fsName))
 	if err != nil {
 		return err
@@ -197,7 +202,12 @@ func (d *cephfs) Delete(op *operations.Operation) error {
 	}
 
 	// Mount the pool.
-	uri := fmt.Sprintf("%s:6789:/", strings.Join(monAddresses, ","))
+	uri := strings.Join(monAddresses, ",")
+	if !strings.Contains(uri, ":6789") {
+		uri = fmt.Sprintf("%s:6789", uri)
+	}
+	uri = fmt.Sprintf("%s:/", uri)
+
 	err = TryMount(uri, mountPoint, "ceph", 0, fmt.Sprintf("name=%v,secret=%v,mds_namespace=%v", d.config["cephfs.user.name"], userSecret, fsName))
 	if err != nil {
 		return err
@@ -269,7 +279,12 @@ func (d *cephfs) Mount() (bool, error) {
 	}
 
 	// Mount the pool.
-	uri := fmt.Sprintf("%s:6789:/%s", strings.Join(monAddresses, ","), fsPath)
+	uri := strings.Join(monAddresses, ",")
+	if !strings.Contains(uri, ":6789") {
+		uri = fmt.Sprintf("%s:6789", uri)
+	}
+	uri = fmt.Sprintf("%s:/%s", uri, fsPath)
+
 	err = TryMount(uri, GetPoolMountPath(d.name), "ceph", 0, fmt.Sprintf("name=%v,secret=%v,mds_namespace=%v", d.config["cephfs.user.name"], userSecret, fsName))
 	if err != nil {
 		return false, err


More information about the lxc-devel mailing list