You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2022/03/21 12:12:10 UTC

[GitHub] [cloudstack] Pearl1594 commented on a change in pull request #6146: configDrive: Fix failure to delete (unstarted) VM

Pearl1594 commented on a change in pull request #6146:
URL: https://github.com/apache/cloudstack/pull/6146#discussion_r831036457



##########
File path: server/src/main/java/com/cloud/network/element/ConfigDriveNetworkElement.java
##########
@@ -639,7 +639,10 @@ private boolean deleteConfigDriveIso(final VirtualMachine vm) throws ResourceUna
 
         if (location == Location.SECONDARY) {
             dataStore = _dataStoreMgr.getImageStoreWithFreeCapacity(vm.getDataCenterId());
-            agentId = findAgentIdForImageStore(dataStore);
+            if (!VirtualMachineManager.VmConfigDriveOnPrimaryPool.valueIn(vm.getDataCenterId()) &&
+                    !VirtualMachineManager.VmConfigDriveForceHostCacheUse.valueIn(vm.getDataCenterId()) && dataStore != null) {
+                agentId = findAgentIdForImageStore(dataStore);

Review comment:
       yes @weizhouapache it could be null - and it's handled by https://github.com/apache/cloudstack/blob/main/server/src/main/java/com/cloud/network/element/ConfigDriveNetworkElement.java#L651 - however, this exception, doesn't prevent the deletion of the VM




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org