mirror of https://github.com/apache/cloudstack.git
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:
parent
1696e8cb16
commit
3ec7f8b99e
|
|
@ -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.");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue