[ https://issues.apache.org/jira/browse/CLOUDSTACK-9175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15171254#comment-15171254 ]
ASF GitHub Bot commented on CLOUDSTACK-9175: -------------------------------------------- Github user GabrielBrascher commented on a diff in the pull request: https://github.com/apache/cloudstack/pull/1257#discussion_r54359804 --- Diff: vmware-base/src/com/cloud/hypervisor/vmware/mo/HostMO.java --- @@ -1110,4 +1148,39 @@ public String getNetworkName(String netMorVal) throws Exception { } return networkName; } + + public void createPortGroup(HostPortGroupSpec spec) throws Exception { + if (spec == null) { + return; + } + + synchronized (_mor.getValue().intern()) { + HostNetworkSystemMO hostNetMo = getHostNetworkSystemMO(); + if (hostNetMo == null) { + return; + } + + ManagedObjectReference morNetwork = getNetworkMor(spec.getName()); + if (morNetwork == null) { + hostNetMo.addPortGroup(spec); + } + } + } + + public void copyPortGroupsFromHost(HostMO srcHost) throws Exception { + if (srcHost == null) { + return; + } + + List<HostPortGroupSpec> portGroupSpecs = srcHost.getHostPortGroupSpecs(); + if (portGroupSpecs == null || portGroupSpecs.isEmpty()) { --- End diff -- Hi @sureshanaparti, could you please use CollectionUtils.isEmpty? It checks if the List is empty, returning true in case of null. (https://commons.apache.org/proper/commons-collections/apidocs/org/apache/commons/collections4/CollectionUtils.html#isEmpty%28java.util.Collection%29) Thanks. > [VMware DRS] Adding new host to DRS cluster does not participate in load > balancing > ---------------------------------------------------------------------------------- > > Key: CLOUDSTACK-9175 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9175 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: Management Server, VMware > Affects Versions: 4.5.2 > Reporter: Suresh Kumar Anaparti > Assignee: Suresh Kumar Anaparti > > When a new VMware host is added into a cluster, Cloudstack, by default, > doesn't create all the port groups present in the cluster. And since it > doesn't have all the necessary networking port groups (existing VM's port > groups) it is not eligible to participate in DRS load balancing or HA. > Steps: > 1. Have a DRS and HA cluster in fully automated mode, with two hosts H1 and > H2 created in the vCenter. > 2. Configure this cluster in Cloudstack and create couple of VMs. > 3. Start stressing the host by running some cpu hogging scripts in each of > the VM. > 4. Enable maintenance mode on one of the host - say H1 from Cloudstack. > 5. Also, quickly enable maintenance mode on host H1 from vCenter. > (This should migrate all the VMs to host H2) Make sure none of the VMs are > present on host H1. > 6. Add host H3 into DRS cluster from vCenter and from Cloudstack as well. > 7. At this point, the load is definitely imbalanced. This can be verified > from vCenter ( Click on cluster -> Go to Summary tab -> under vSphere DRS > section, it should show 'Load imbalanced' > Now, as per DRS rules, the load should be balanced across all the available > hosts. > In this case, even after adding new host, the load is imbalanced. > The reason for the load imbalance is VMs (created from Cloudstack) are not > eligible to migrate to new host because networks or the cloud portgroups are > not available on the new host H3 (except for private). -- This message was sent by Atlassian JIRA (v6.3.4#6332)