[ https://issues.apache.org/jira/browse/CLOUDSTACK-8820?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14743308#comment-14743308 ]
ASF GitHub Bot commented on CLOUDSTACK-8820: -------------------------------------------- Github user sureshanaparti commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/806#discussion_r39378030 --- Diff: vmware-base/src/com/cloud/hypervisor/vmware/util/VmwareClient.java --- @@ -577,41 +590,48 @@ public ManagedObjectReference getDecendentMoRef(ManagedObjectReference root, Str return null; } - // Create PropertySpecs - PropertySpec pSpec = new PropertySpec(); - pSpec.setType(type); - pSpec.setAll(false); - pSpec.getPathSet().add("name"); - - ObjectSpec oSpec = new ObjectSpec(); - oSpec.setObj(root); - oSpec.setSkip(false); - oSpec.getSelectSet().addAll(constructCompleteTraversalSpec()); - - PropertyFilterSpec spec = new PropertyFilterSpec(); - spec.getPropSet().add(pSpec); - spec.getObjectSet().add(oSpec); - List<PropertyFilterSpec> specArr = new ArrayList<PropertyFilterSpec>(); - specArr.add(spec); - - List<ObjectContent> ocary = vimPort.retrieveProperties(getPropCol(), specArr); - - if (ocary == null || ocary.size() == 0) { - return null; - } + try { + // Create PropertySpecs + PropertySpec pSpec = new PropertySpec(); + pSpec.setType(type); + pSpec.setAll(false); + pSpec.getPathSet().add("name"); + + ObjectSpec oSpec = new ObjectSpec(); + oSpec.setObj(root); + oSpec.setSkip(false); + oSpec.getSelectSet().addAll(constructCompleteTraversalSpec()); + + PropertyFilterSpec spec = new PropertyFilterSpec(); + spec.getPropSet().add(pSpec); + spec.getObjectSet().add(oSpec); + List<PropertyFilterSpec> specArr = new ArrayList<PropertyFilterSpec>(); + specArr.add(spec); + + ManagedObjectReference propCollector = getPropCol(); + List<ObjectContent> ocary = vimPort.retrieveProperties(propCollector, specArr); + + if (ocary == null || ocary.size() == 0) { + return null; + } - // filter through retrieved objects to get the first match. - for (ObjectContent oc : ocary) { - ManagedObjectReference mor = oc.getObj(); - List<DynamicProperty> propary = oc.getPropSet(); - if (type == null || type.equals(mor.getType())) { - if (propary.size() > 0) { - String propval = (String)propary.get(0).getVal(); - if (propval != null && name.equalsIgnoreCase(propval)) - return mor; + // filter through retrieved objects to get the first match. + for (ObjectContent oc : ocary) { + ManagedObjectReference mor = oc.getObj(); + List<DynamicProperty> propary = oc.getPropSet(); + if (type == null || type.equals(mor.getType())) { + if (propary.size() > 0) { + String propval = (String)propary.get(0).getVal(); + if (propval != null && name.equalsIgnoreCase(propval)) + return mor; + } } } + } catch (Exception e) { + s_logger.debug("Failed to get mor for name: " + name + " and type: " + type, e); --- End diff -- MoRef i.e VMware ManagedObjectReference. Updated the log. > Showing error when try to add advance zone using VMWare ESXi 6.0 host > --------------------------------------------------------------------- > > Key: CLOUDSTACK-8820 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-8820 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: VMware > Affects Versions: 4.6.0 > Reporter: shweta agarwal > Assignee: Suresh Kumar Anaparti > Priority: Critical > > Steps to reproduce: > 1.Installed VMWare Server 6.0 > 2.Installed VMware Vsphere Client 6.0 > 3.Prepared vmware host using VMware-VMvisor-Installer-6.0.0-2494585.x86_64.iso > 4.Added vmware host to VMware Vsphere Client 6.0. > 5.Prepared latest CS setup > 6. Try creating a vmware zone using a vmware 6.0 host > Actual behavior: > Showing error 'Failed to add VMware DC to zone due to : null' when try to add > advance zone using VMWare ESXi 6.0 host. > Expected behavior: > Add advance zone operation should be successful. -- This message was sent by Atlassian JIRA (v6.3.4#6332)