From a0b45a2bcd2e9cb7004aa6b3c9fea9fd8c70ea93 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sat, 30 Sep 2023 12:37:43 -0400 Subject: [PATCH] Always create RBDs with bytes value Converting into human results in imprecise values when specifying bytes directly, which in turn breaks VMDK image uploads. Instead, just use the raw bytes value when creating the volume instead of converting it back. --- daemon-common/ceph.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/daemon-common/ceph.py b/daemon-common/ceph.py index 0ab9bec5..0cd54dd6 100644 --- a/daemon-common/ceph.py +++ b/daemon-common/ceph.py @@ -763,9 +763,7 @@ def add_volume(zkhandler, pool, name, size): # 2. Create the volume retcode, stdout, stderr = common.run_os_command( - "rbd create --size {} {}/{}".format( - format_bytes_tohuman(size_bytes), pool, name - ) + "rbd create --size {}B {}/{}".format(size_bytes, pool, name) ) if retcode: return False, 'ERROR: Failed to create RBD volume "{}": {}'.format(name, stderr)