File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
server/src/com/cloud/configuration Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -954,7 +954,11 @@ protected void checkIfPodIsDeletable(long podId) {
954954
955955 String selectSql = "SELECT * FROM `" + dbName + "`.`" + tableName + "` WHERE " + column + " = ?" ;
956956
957- if (tableName .equals ("host" ) || tableName .equals ("cluster" ) || tableName .equals ("volumes" ) || tableName .equals ("vm_instance" )) {
957+ if (tableName .equals ("vm_instance" )) {
958+ selectSql += " AND state != '" + VirtualMachine .State .Expunging .toString () + "' AND removed IS NULL" ;
959+ }
960+
961+ if (tableName .equals ("host" ) || tableName .equals ("cluster" ) || tableName .equals ("volumes" )) {
958962 selectSql += " and removed IS NULL" ;
959963 }
960964
@@ -1426,7 +1430,7 @@ protected void checkIfZoneIsDeletable(long zoneId) {
14261430 }
14271431
14281432 if (tableName .equals ("vm_instance" )) {
1429- selectSql += " AND state != '" + VirtualMachine .State .Expunging .toString () + "'" ;
1433+ selectSql += " AND state != '" + VirtualMachine .State .Expunging .toString () + "' AND removed IS NULL " ;
14301434 }
14311435
14321436 TransactionLegacy txn = TransactionLegacy .currentTxn ();
You can’t perform that action at this time.
0 commit comments