Updated Branches: refs/heads/master 4c397da8f -> 89fa121a0
CLOUDSTACK-2867 Cannot add multiple vmware zones in vCenter Checking guid in database, if association of DC to zone exists already. Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/3ec7f8b9 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/3ec7f8b9 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/3ec7f8b9 Branch: refs/heads/master Commit: 3ec7f8b99ebe9c02a6b6ed69efdb72dfb9543b3b Parents: 1696e8c Author: Sateesh Chodapuneedi <sate...@apache.org> Authored: Thu Jun 6 14:33:05 2013 +0530 Committer: Sateesh Chodapuneedi <sate...@apache.org> Committed: Thu Jun 6 14:33:05 2013 +0530 ---------------------------------------------------------------------- .../vmware/manager/VmwareManagerImpl.java | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3ec7f8b9/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java ---------------------------------------------------------------------- diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java index 78b7582..664651e 100755 --- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java +++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java @@ -947,8 +947,8 @@ public class VmwareManagerImpl extends ManagerBase implements VmwareManager, Vmw // Check if DC is already part of zone // In that case vmware_data_center table should have the DC String vCenterHost = uri.getHost(); - List<VmwareDatacenterVO> vmwareDcs = _vmwareDcDao.getVmwareDatacenterByNameAndVcenter(vmwareDcName, vCenterHost); - if (vmwareDcs != null && vmwareDcs.size() != 0) { + vmwareDc = _vmwareDcDao.getVmwareDatacenterByGuid(vmwareDcName + "@" + vCenterHost); + if (vmwareDc != null) { throw new ResourceInUseException("This DC is already part of other CloudStack zone(s). Cannot add this DC to more zones."); }