one icon indicating copy to clipboard operation
one copied to clipboard

Image removal has a bug regarding finding the file

Open tsarajar opened this issue 6 months ago • 0 comments

Description When deleting an image with "oneimage delete xxx", the driver will fail deleting the image on the disk every time. That's because OpenNebulaTemplate.cc combines two variables like this: set_conf_single("DATASTORE_LOCATION", var_location + "/datastores"); and oned.cc defines var_location as: /var/lib/one/

So the end resulting DATASTORE_LOCATION will end up looking like /var/lib/one//datastores.

This causes problems in drivers trying to delete and doing this comparison: if [ -f "$SRC" -a dirname "$SRC" = "$BASE_PATH" -a -n "$BASENAME_SRC" ]

It will fail due to paths having different amount of forward slashes.

To Reproduce Try to delete an image with oneimage delete

Expected behavior Image gets deleted in both the database and disk

Details

  • Affected Component: No idea
  • Hypervisor: KVM
  • Version: 7.0.1

Additional context

Progress Status

  • [ ] Code committed
  • [ ] Testing - QA
  • [ ] Documentation (Release notes - resolved issues, compatibility, known issues)

tsarajar avatar May 11 '26 10:05 tsarajar