Skip to content

Instantly share code, notes, and snippets.

@j-griffith
Created November 22, 2017 18:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save j-griffith/d53b95071bd9d7969cf92ea10b08d248 to your computer and use it in GitHub Desktop.
Save j-griffith/d53b95071bd9d7969cf92ea10b08d248 to your computer and use it in GitHub Desktop.
Handle deleting volumes that were migrated *too* SolidFire
diff --git a/cinder/volume/drivers/solidfire.py b/cinder/volume/drivers/solidfire.py
index 34da2e8..c44975a 100644
--- a/cinder/volume/drivers/solidfire.py
+++ b/cinder/volume/drivers/solidfire.py
@@ -1436,8 +1436,19 @@ class SolidFireDriver(san.SanISCSIDriver):
return
for acc in accounts:
+ # NOTE(jdg): migration is a special case, when migrating
+ # *from* a device the volume needs to be accessed by the
+ # old migration_uuid (name_id), but in the case of a
+ # a volume that was migrated *to* this device, the migration
+ # code is "nice" enough to do a UUID swap, and we need to
+ # access it by the new UUID that no longer matches name_id :(
vols = self._get_volumes_for_account(acc['accountID'],
volume['name_id'])
+ # Handle the annoying case of volumes being migrated onto SF
+ if not vols:
+ vols = self._get_volumes_for_account(acc['accountID'],
+ volume['id'])
+ # Ok, for real now
if vols:
sf_vol = vols[0]
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment