Skip to content

Commit 8785f78

Browse files
mlsorensenMarcus Sorensen
andauthored
Ignore calls to PowerFlex for host revocation when host is null (#6742)
This PR Fixes #6739 (for PowerFlex/ScaleIO only, Datera still needs to be addressed), which can occur if the last host the VM ran on is deleted from CloudStack. At the point the VM is deleted, cloudstack attempts to make a final call to revoke access to volumes, passing the last host the VM ran on. If this host is gone, we get an error and are unable to delete the VM. It's possible that there may be a more holistic fix to this by identifying all of the places where revokeAccess() is called and checking for null host. It's possible other storage plugins don't even need host information to revoke access to volumes and may need this call to revoke. Therefore I'm only applying this fix to the ScaleIOPrimaryDataStoreDriver to skip revoking access when there is no host to revoke access for, and this should protect us as well when a new part of the code tries to use revokeAccess() in the future. Signed-off-by: Marcus Sorensen <mls@apple.com> Co-authored-by: Marcus Sorensen <mls@apple.com>
1 parent 93f0926 commit 8785f78

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

plugins/storage/volume/scaleio/src/main/java/org/apache/cloudstack/storage/datastore/driver/ScaleIOPrimaryDataStoreDriver.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,11 @@ private boolean grantAccess(DataObject dataObject, EndPoint ep, DataStore dataSt
208208

209209
@Override
210210
public void revokeAccess(DataObject dataObject, Host host, DataStore dataStore) {
211+
if (host == null) {
212+
LOGGER.info("Declining to revoke access to PowerFlex volume when a host is not provided");
213+
return;
214+
}
215+
211216
try {
212217
if (DataObjectType.VOLUME.equals(dataObject.getType())) {
213218
final VolumeVO volume = volumeDao.findById(dataObject.getId());

0 commit comments

Comments
 (0)