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.
This commit is contained in:
Joshua Boniface 2023-09-30 12:37:43 -04:00
parent 35e27f79ef
commit a0b45a2bcd
1 changed files with 1 additions and 3 deletions

View File

@ -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)