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 <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/99e9f5d3 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/99e9f5d3 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/99e9f5d3 Branch: refs/heads/master Commit: 99e9f5d308f8deb80f346ed47b09594fe60bf9db Parents: af4177b Author: Sateesh Chodapuneedi <[email protected]> Authored: Thu May 23 12:23:06 2013 +0530 Committer: Sateesh Chodapuneedi <[email protected]> Committed: Fri May 31 13:33:45 2013 +0530 ---------------------------------------------------------------------- .../hypervisor/vmware/mo/CustomFieldConstants.java | 1 + .../cloud/hypervisor/vmware/mo/DatacenterMO.java | 5 +++++ 2 files changed, 6 insertions(+), 0 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/99e9f5d3/vmware-base/src/com/cloud/hypervisor/vmware/mo/CustomFieldConstants.java ---------------------------------------------------------------------- diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/mo/CustomFieldConstants.java b/vmware-base/src/com/cloud/hypervisor/vmware/mo/CustomFieldConstants.java index 4cd5f9b..11bc157 100644 --- a/vmware-base/src/com/cloud/hypervisor/vmware/mo/CustomFieldConstants.java +++ b/vmware-base/src/com/cloud/hypervisor/vmware/mo/CustomFieldConstants.java @@ -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"; } http://git-wip-us.apache.org/repos/asf/cloudstack/blob/99e9f5d3/vmware-base/src/com/cloud/hypervisor/vmware/mo/DatacenterMO.java ---------------------------------------------------------------------- diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/mo/DatacenterMO.java b/vmware-base/src/com/cloud/hypervisor/vmware/mo/DatacenterMO.java index 0a3e20b..cabb60a 100755 --- a/vmware-base/src/com/cloud/hypervisor/vmware/mo/DatacenterMO.java +++ b/vmware-base/src/com/cloud/hypervisor/vmware/mo/DatacenterMO.java @@ -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; + } }
