From e9df9c29bde4374e443c91ed91e2706b6074082f Mon Sep 17 00:00:00 2001 From: Sateesh Chodapuneedi Date: Mon, 24 Jun 2013 12:11:31 +0530 Subject: [PATCH] CLOUDSTACK-3155 [VMware] Deletion of zone should not be allowed if VMware DC is still associated with that zone. Check if there exists any VMware DC already associated with this zone. Deny zone deletion if true. Signed-off-by: Sateesh Chodapuneedi --- .../com/cloud/configuration/ConfigurationManagerImpl.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java index 425c8be5034..89a640daed4 100755 --- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java +++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java @@ -1301,6 +1301,12 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati physicalNetworks.add(2, "there are physical networks in this zone"); tablesToCheck.add(physicalNetworks); + List vmwareDcs = new ArrayList(); + vmwareDcs.add(0, "vmware_data_center_zone_map"); + vmwareDcs.add(1, "zone_id"); + vmwareDcs.add(2, "there are VMware datacenters associated with this zone. Remove VMware DC from this zone."); + tablesToCheck.add(vmwareDcs); + for (List table : tablesToCheck) { String tableName = table.get(0); String column = table.get(1);