CLOUDSTACK-1963 New mapping model for CloudStack zone and Vmware datacenter

Support for custom field "cloud.zone" for datacenter object in vCenter.

Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org>
This commit is contained in:
Sateesh Chodapuneedi 2013-05-23 12:23:06 +05:30
parent af4177b86c
commit 99e9f5d308
2 changed files with 6 additions and 0 deletions

View File

@ -21,4 +21,5 @@ public interface CustomFieldConstants {
public final static String CLOUD_GC = "cloud.gc";
public final static String CLOUD_GC_DVP = "cloud.gc.dvp";
public final static String CLOUD_NIC_MASK = "cloud.nic.mask";
public final static String CLOUD_ZONE = "cloud.zone";
}

View File

@ -488,4 +488,9 @@ public class DatacenterMO extends BaseMO {
dvSwitchMor = _context.getVimClient().getDecendentMoRef(networkFolderMor, "VmwareDistributedVirtualSwitch", dvSwitchName);
return dvSwitchMor;
}
public boolean ensureCustomFieldDef(String fieldName) throws Exception {
CustomFieldsManagerMO cfmMo = new CustomFieldsManagerMO(_context, _context.getServiceContent().getCustomFieldsManager());
return cfmMo.ensureCustomFieldDef("Datacenter", fieldName) > 0;
}
}