You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ke...@apache.org on 2013/08/28 00:17:25 UTC
git commit: updated refs/heads/4.2-forward to 687e87f
Updated Branches:
refs/heads/4.2-forward 8e350cb29 -> 687e87faa
CLOUDSTACK-4529: use property collector to collect all information in one round
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/687e87fa
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/687e87fa
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/687e87fa
Branch: refs/heads/4.2-forward
Commit: 687e87faa7a2d828fa428ac0b013e0c1de361bdc
Parents: 8e350cb
Author: Kelven Yang <ke...@gmail.com>
Authored: Tue Aug 27 15:04:17 2013 -0700
Committer: Kelven Yang <ke...@gmail.com>
Committed: Tue Aug 27 15:04:31 2013 -0700
----------------------------------------------------------------------
.../src/com/cloud/hypervisor/vmware/mo/HostMO.java | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/687e87fa/vmware-base/src/com/cloud/hypervisor/vmware/mo/HostMO.java
----------------------------------------------------------------------
diff --git a/vmware-base/src/com/cloud/hypervisor/vmware/mo/HostMO.java b/vmware-base/src/com/cloud/hypervisor/vmware/mo/HostMO.java
index c0ef217..49a340c 100755
--- a/vmware-base/src/com/cloud/hypervisor/vmware/mo/HostMO.java
+++ b/vmware-base/src/com/cloud/hypervisor/vmware/mo/HostMO.java
@@ -35,6 +35,7 @@ import com.vmware.vim25.AboutInfo;
import com.vmware.vim25.AlreadyExistsFaultMsg;
import com.vmware.vim25.ClusterDasConfigInfo;
import com.vmware.vim25.ComputeResourceSummary;
+import com.vmware.vim25.CustomFieldStringValue;
import com.vmware.vim25.DatastoreSummary;
import com.vmware.vim25.DynamicProperty;
import com.vmware.vim25.HostConfigManager;
@@ -577,8 +578,14 @@ public class HostMO extends BaseMO implements VmwareHypervisorHost {
}
public HashMap<String, Integer> getVmVncPortsOnHost() throws Exception {
+
+ int key = getCustomFieldKey("VirtualMachine", CustomFieldConstants.CLOUD_VM_INTERNAL_NAME);
+ if(key == 0) {
+ s_logger.warn("Custom field " + CustomFieldConstants.CLOUD_VM_INTERNAL_NAME + " is not registered ?!");
+ }
+
ObjectContent[] ocs = getVmPropertiesOnHyperHost(
- new String[] { "name", "config.extraConfig[\"RemoteDisplay.vnc.port\"]" }
+ new String[] { "name", "config.extraConfig[\"RemoteDisplay.vnc.port\"]", "value[" + key + "]" }
);
HashMap<String, Integer> portInfo = new HashMap<String, Integer>();
@@ -592,14 +599,15 @@ public class HostMO extends BaseMO implements VmwareHypervisorHost {
for(DynamicProperty objProp : objProps) {
if(objProp.getName().equals("name")) {
vmName = (String)objProp.getVal();
+ } else if(objProp.getName().startsWith("value[")) {
+ if(objProp.getVal() != null)
+ vmInternalCSName = ((CustomFieldStringValue)objProp.getVal()).getValue();
} else {
OptionValue optValue = (OptionValue)objProp.getVal();
value = (String)optValue.getValue();
}
}
- VirtualMachineMO vmMo = new VirtualMachineMO(_context, oc.getObj());
- // Check if vmMo has the custom property CLOUD_VM_INTERNAL_NAME set.
- vmInternalCSName = vmMo.getCustomFieldValue(CustomFieldConstants.CLOUD_VM_INTERNAL_NAME);
+
if (vmInternalCSName != null && isUserVMInternalCSName(vmInternalCSName))
vmName = vmInternalCSName;