CLOUDSTACK-2867 Cannot add multiple vmware zones in vCenter

Checking guid in database, if association of DC to zone exists already.
This commit is contained in:
Sateesh Chodapuneedi 2013-06-06 14:33:05 +05:30
parent 1696e8cb16
commit 3ec7f8b99e
1 changed files with 2 additions and 2 deletions

View File

@ -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.");
}