Force-deleting a volume may fail

Follow

This article applies to OpenStack versions prior to Ocata.

For OpenStack Ocata or later, see OpenStack InfiniBox Volume Driver.

 

The default behaviour of our volume driver is to call use the DELETE API of InfiniBox in the implementation of Cinder delete_volume method.

If everything works correctly, this shouldn't be a problem for Cinder, since it controls the snapshots and volume mappings and will not allow even call our API - it will validate beforehand that the volume is not being used.

Cinder also exposed a method to the client named force-delete which bypasses all the validations; problem is that it doesn't pass the force to the volume driver, and we cannot tell if the user requested a force-delete and expects us to do whatever it takes to delete the volume (such as removing LUN mappings, deleting the snapshot tree, etc).

There was two ways customers can handle this situation:

  • Delete the volume mappings and snapshots from InfiniBox GUI/CLI and then run Cinder's force-delete again, and it should work this time
  • Set infinidat_purge_volume_on_deletion = True in the backend configuration and then use the force-delete command; when this parameter is set to true, we will use the purge method in infinipy, which will recursively purge all the volume's children, remove the volume mappings and then delete it (assuming the user has credentials to do all that).

 

There's no option to set this parameter with infini-openstack (our command-line tool); this needs to be done manually by modifying the cinder configuration file (the default location is /etc/cinder/cinder.conf). Here's a sample diff when applying this change: 

 

 [infinibox-10000-pool-1]
 volume_driver = infinidat_openstack.cinder.InfiniboxVolumeDriver
 san_ip = box-demo
 infinidat_pool_id = 1
 san_login = admin
 san_password = 123456
 infinidat_provision_type = thin
 infinidat_prefer_fc = False
 infinidat_allow_pool_not_found = False
-infinidat_purge_volume_on_deletion = False
+infinidat_purge_volume_on_deletion = True

 

 

 

It doesn't matter if the value is True or true



Comments