Compare commits

...

2 Commits

Author SHA1 Message Date
bbb940da65 Remove spurious comments 2023-09-30 12:37:58 -04:00
a0b45a2bcd 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.
2023-09-30 12:37:43 -04:00
2 changed files with 1 additions and 5 deletions

View File

@ -1629,7 +1629,6 @@ def ceph_volume_upload(zkhandler, pool, volume, img_type, file_size=None):
zkhandler, pool, "{}_tmp".format(volume)
)
# Create a temporary block device to store non-raw images
if img_type == "raw":
if file_size != dev_size:
output = {
@ -1676,7 +1675,6 @@ def ceph_volume_upload(zkhandler, pool, volume, img_type, file_size=None):
cleanup_maps_and_volumes()
return output, retcode
# Write the image directly to the blockdev
else:
if file_size is None:
output = {"message": "A file size must be specified"}

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)