Skip to content

Commit 3ec7f8b

Browse files
author
Sateesh Chodapuneedi
committed
CLOUDSTACK-2867 Cannot add multiple vmware zones in vCenter
Checking guid in database, if association of DC to zone exists already.
1 parent 1696e8c commit 3ec7f8b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareManagerImpl.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -947,8 +947,8 @@ public VmwareDatacenterVO addVmwareDatacenter(AddVmwareDcCmd cmd) throws Resourc
947947
// Check if DC is already part of zone
948948
// In that case vmware_data_center table should have the DC
949949
String vCenterHost = uri.getHost();
950-
List<VmwareDatacenterVO> vmwareDcs = _vmwareDcDao.getVmwareDatacenterByNameAndVcenter(vmwareDcName, vCenterHost);
951-
if (vmwareDcs != null && vmwareDcs.size() != 0) {
950+
vmwareDc = _vmwareDcDao.getVmwareDatacenterByGuid(vmwareDcName + "@" + vCenterHost);
951+
if (vmwareDc != null) {
952952
throw new ResourceInUseException("This DC is already part of other CloudStack zone(s). Cannot add this DC to more zones.");
953953
}
954954

0 commit comments

Comments
 (0)