You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/02/18 10:35:04 UTC

[GitHub] [cloudstack] Spaceman1984 opened a new pull request #4701: Added support for removing unused port groups on VMWare

Spaceman1984 opened a new pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701


   ### Description
   
   This PR adds a global setting (vmware.cleanup.port.groups) to toggle removing unused port groups.
   <!--- Describe your changes in DETAIL - And how has behaviour functionally changed. -->
   
   <!-- For new features, provide link to FS, dev ML discussion etc. -->
   <!-- In case of bug fix, the expected and actual behaviours, steps to reproduce. -->
   
   <!-- When "Fixes: #<id>" is specified, the issue/PR will automatically be closed when this PR gets merged -->
   <!-- For addressing multiple issues/PRs, use multiple "Fixes: #<id>" -->
   <!-- Fixes: # -->
   Fixes: #3779 
   <!--- ********************************************************************************* -->
   <!--- NOTE: AUTOMATATION USES THE DESCRIPTIONS TO SET LABELS AND PRODUCE DOCUMENTATION. -->
   <!--- PLEASE PUT AN 'X' in only **ONE** box -->
   <!--- ********************************************************************************* -->
   
   ### Types of changes
   
   - [ ] Breaking change (fix or feature that would cause existing functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [x] Bug fix (non-breaking change which fixes an issue)
   - [x] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Feature/Enhancement Scale
   
   - [ ] Major
   - [x] Minor
   
   #### Bug Severity
   
   - [ ] BLOCKER
   - [ ] Critical
   - [ ] Major
   - [x] Minor
   - [ ] Trivial
   
   
   ### Screenshots (if appropriate):
   
   
   ### How Has This Been Tested?
   <!-- Please describe in detail how you tested your changes. -->
   <!-- Include details of your testing environment, and the tests you ran to -->
   <!-- see how your change affects other areas of the code, etc. -->
   This has been tested by:
   * Set global setting (vmware.cleanup.port.groups) to true or false.
   * Create an instance on a new network.
   * Check Vsphere client for the newly created port group.
   * Destroy and expunge the instance.
   * Destroy the router.
   * Check vSphere if the port group has been removed or not, depending on global setting (vmware.cleanup.port.groups)
   
   <!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/master/CONTRIBUTING.md) document -->
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] Spaceman1984 commented on a change in pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
Spaceman1984 commented on a change in pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#discussion_r592196315



##########
File path: plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/manager/VmwareManager.java
##########
@@ -46,6 +46,9 @@
     static final ConfigKey<Integer> s_vmwareOVAPackageTimeout = new ConfigKey<Integer>(Integer.class, "vmware.package.ova.timeout", "Advanced", "3600",
             "Vmware script timeout for ova packaging process", true, ConfigKey.Scope.Global, 1000);
 
+    static final ConfigKey<Boolean> s_vmwareCleanupPortGroups = new ConfigKey<Boolean>("Advanced", Boolean.class, "vmware.cleanup.port.groups",  "true",
+            "Remove unused port groups.", true, ConfigKey.Scope.Global);

Review comment:
       Addressed




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] Spaceman1984 commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
Spaceman1984 commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-883150020






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] nvazquez commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
nvazquez commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-883008282


   @Spaceman1984 can you please fix the conflicts?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-884892891


   @nvazquez a Trillian-Jenkins test job (centos7 mgmt + vmware-67u3) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#discussion_r591246254



##########
File path: plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/manager/VmwareManager.java
##########
@@ -46,6 +46,9 @@
     static final ConfigKey<Integer> s_vmwareOVAPackageTimeout = new ConfigKey<Integer>(Integer.class, "vmware.package.ova.timeout", "Advanced", "3600",
             "Vmware script timeout for ova packaging process", true, ConfigKey.Scope.Global, 1000);
 
+    static final ConfigKey<Boolean> s_vmwareCleanupPortGroups = new ConfigKey<Boolean>("Advanced", Boolean.class, "vmware.cleanup.port.groups",  "true",
+            "Remove unused port groups.", true, ConfigKey.Scope.Global);

Review comment:
       Any reason to keep default value 'true' ? I think, Default value 'false' will keep the old behavior after upgrade, and up to admin to set it to 'true' to cleanup the port groups.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-884854380


   @nvazquez a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] Spaceman1984 commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
Spaceman1984 commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-883150020






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] GutoVeronezi commented on a change in pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
GutoVeronezi commented on a change in pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#discussion_r590622664



##########
File path: plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java
##########
@@ -5732,16 +5733,24 @@ protected Answer execute(UnregisterNicCommand cmd) {
     }
 
     public void cleanupNetwork(HostMO hostMo, NetworkDetails netDetails) {
-        // we will no longer cleanup VLAN networks in order to support native VMware HA
-        /*
-         * assert(netDetails.getName() != null); try { synchronized(this) { NetworkMO networkMo = new
-         * NetworkMO(hostMo.getContext(), netDetails.getNetworkMor()); ManagedObjectReference[] vms =
-         * networkMo.getVMsOnNetwork(); if(vms == null || vms.length == 0) { if(s_logger.isInfoEnabled()) {
-         * s_logger.info("Cleanup network as it is currently not in use: " + netDetails.getName()); }
-         *
-         * hostMo.deletePortGroup(netDetails.getName()); } } } catch(Throwable e) {
-         * s_logger.warn("Unable to cleanup network due to exception, skip for next time"); }
-         */
+        if (!VmwareManager.s_vmwareCleanupPortGroups.value()){
+            return;
+        }
+        assert(netDetails.getName() != null);
+        try {
+            synchronized(this) {
+                NetworkMO networkMo = new NetworkMO(hostMo.getContext(), netDetails.getNetworkMor());
+                List<ManagedObjectReference> vms = networkMo.getVMsOnNetwork();
+                if(vms == null || vms.size() == 0) {

Review comment:
       Suggestion:
   Use `vms.isEmpty()` instead of `vms.size() == 0`.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-781248822


   @Spaceman1984 a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] nvazquez commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
nvazquez commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-883008282


   @Spaceman1984 can you please fix the conflicts?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-905291606


   <b>Trillian test result (tid-1763)</b>
   Environment: vmware-67u3 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 64141 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4701-t1763-vmware-67u3.zip
   Intermittent failure detected: /marvin/tests/smoke/test_internal_lb.py
   Intermittent failure detected: /marvin/tests/smoke/test_privategw_acl.py
   Intermittent failure detected: /marvin/tests/smoke/test_vm_life_cycle.py
   Intermittent failure detected: /marvin/tests/smoke/test_vpc_redundant.py
   Intermittent failure detected: /marvin/tests/smoke/test_vpc_vpn.py
   Smoke tests completed. 87 look OK, 2 have error(s)
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_02_internallb_roundrobin_1RVPC_3VM_HTTP_port80 | `Failure` | 1074.85 | test_internal_lb.py
   test_09_expunge_vm | `Failure` | 423.54 | test_vm_life_cycle.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-883150181


   @Spaceman1984 a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] Spaceman1984 commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
Spaceman1984 commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-867360115


   > Hi @Spaceman1984 there are some open questions on this PR, can you please advise?
   
   Sure, @nvazquez 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] Spaceman1984 commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
Spaceman1984 commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-883189800


   @blueorangutan test centos7 vmware-67u3


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-796597346


   @Spaceman1984 a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. [S]


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] Spaceman1984 edited a comment on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
Spaceman1984 edited a comment on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-867361421


   > code looks good @Spaceman1984 , but i don't see how it is being called. Am I missing something?
   
   This setting is checked when an instance is destroyed @DaanHoogland. If the instance being destroyed is the last instance (including VR) using a specific network, the port group will be removed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] nvazquez commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
nvazquez commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-883008282


   @Spaceman1984 can you please fix the conflicts?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-904656213


   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] nvazquez merged pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
nvazquez merged pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-907355805


   @nvazquez a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] DaanHoogland commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-907021900


   @Spaceman1984, can you look at the conflicts here


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-895935571


   > @sureshanaparti @andrijapanicsb @borisstoyanov @vladimirpetrov @nvazquez are we lgtm to merge this?
   
   no @rhtyd 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] nvazquez commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
nvazquez commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-895739870


   @Spaceman1984 could you check @sureshanaparti's last comment? 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] Spaceman1984 commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
Spaceman1984 commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-781288094


   @blueorangutan test centos7 vmware-67u3


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] Spaceman1984 commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
Spaceman1984 commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-781248116


   @blueorangutan package


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-904681675


   @sureshanaparti a Trillian-Jenkins test job (centos7 mgmt + vmware-67u3) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] GabrielBrascher commented on a change in pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
GabrielBrascher commented on a change in pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#discussion_r590653001



##########
File path: plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java
##########
@@ -5732,16 +5733,24 @@ protected Answer execute(UnregisterNicCommand cmd) {
     }
 
     public void cleanupNetwork(HostMO hostMo, NetworkDetails netDetails) {
-        // we will no longer cleanup VLAN networks in order to support native VMware HA
-        /*
-         * assert(netDetails.getName() != null); try { synchronized(this) { NetworkMO networkMo = new
-         * NetworkMO(hostMo.getContext(), netDetails.getNetworkMor()); ManagedObjectReference[] vms =
-         * networkMo.getVMsOnNetwork(); if(vms == null || vms.length == 0) { if(s_logger.isInfoEnabled()) {
-         * s_logger.info("Cleanup network as it is currently not in use: " + netDetails.getName()); }
-         *
-         * hostMo.deletePortGroup(netDetails.getName()); } } } catch(Throwable e) {
-         * s_logger.warn("Unable to cleanup network due to exception, skip for next time"); }
-         */
+        if (!VmwareManager.s_vmwareCleanupPortGroups.value()){
+            return;
+        }
+        assert(netDetails.getName() != null);
+        try {
+            synchronized(this) {
+                NetworkMO networkMo = new NetworkMO(hostMo.getContext(), netDetails.getNetworkMor());
+                List<ManagedObjectReference> vms = networkMo.getVMsOnNetwork();
+                if(vms == null || vms.size() == 0) {

Review comment:
       @GutoVeronezi `vms.isEmpty()` is a nice option indeed. I would suggest [CollectionsUtils.isEmpty(vms)](https://commons.apache.org/proper/commons-collections/apidocs/org/apache/commons/collections4/CollectionUtils.html#isEmpty-java.util.Collection-) as it is a null safe validation.
   
   `if(vms == null || vms.size() == 0) {` :arrow_right: `if (CollectionUtils.isEmpty(vms)) {`
   
   
   

##########
File path: plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java
##########
@@ -5732,16 +5733,24 @@ protected Answer execute(UnregisterNicCommand cmd) {
     }
 
     public void cleanupNetwork(HostMO hostMo, NetworkDetails netDetails) {
-        // we will no longer cleanup VLAN networks in order to support native VMware HA
-        /*
-         * assert(netDetails.getName() != null); try { synchronized(this) { NetworkMO networkMo = new
-         * NetworkMO(hostMo.getContext(), netDetails.getNetworkMor()); ManagedObjectReference[] vms =
-         * networkMo.getVMsOnNetwork(); if(vms == null || vms.length == 0) { if(s_logger.isInfoEnabled()) {
-         * s_logger.info("Cleanup network as it is currently not in use: " + netDetails.getName()); }
-         *
-         * hostMo.deletePortGroup(netDetails.getName()); } } } catch(Throwable e) {
-         * s_logger.warn("Unable to cleanup network due to exception, skip for next time"); }
-         */
+        if (!VmwareManager.s_vmwareCleanupPortGroups.value()){
+            return;
+        }
+        assert(netDetails.getName() != null);

Review comment:
       I would recommend using an `if` statement in the place of the `assert`. It would allow launching an exception with a  verbose log message regarding the network cleanup failure.
   
   But no problem at all, assert is fine here if you prefer.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] Spaceman1984 commented on a change in pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
Spaceman1984 commented on a change in pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#discussion_r657649748



##########
File path: plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/manager/VmwareManager.java
##########
@@ -46,6 +46,9 @@
     static final ConfigKey<Integer> s_vmwareOVAPackageTimeout = new ConfigKey<Integer>(Integer.class, "vmware.package.ova.timeout", "Advanced", "3600",
             "Vmware script timeout for ova packaging process", true, ConfigKey.Scope.Global, 1000);
 
+    static final ConfigKey<Boolean> s_vmwareCleanupPortGroups = new ConfigKey<Boolean>("Advanced", Boolean.class, "vmware.cleanup.port.groups",  "false",
+            "Remove unused port groups. WARNING: When set to true, native VMware HA might not work.", true, ConfigKey.Scope.Global);

Review comment:
       > Hi @Spaceman1984 there are some open questions on this PR, can you please advise?
   
   Sure @nvazquez 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#discussion_r595775182



##########
File path: plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/manager/VmwareManager.java
##########
@@ -46,6 +46,9 @@
     static final ConfigKey<Integer> s_vmwareOVAPackageTimeout = new ConfigKey<Integer>(Integer.class, "vmware.package.ova.timeout", "Advanced", "3600",
             "Vmware script timeout for ova packaging process", true, ConfigKey.Scope.Global, 1000);
 
+    static final ConfigKey<Boolean> s_vmwareCleanupPortGroups = new ConfigKey<Boolean>("Advanced", Boolean.class, "vmware.cleanup.port.groups",  "false",
+            "Remove unused port groups. WARNING: When set to true, native VMware HA might not work.", true, ConfigKey.Scope.Global);

Review comment:
       @Spaceman1984 If my understanding is correct, cleanup port groups happens only on the network cleanup only and the old uncleaned port groups of other networks (when this setting is false) still remains. If so, Can you mention in the setting description that port groups cleanup happens on the network cleanup for that network only.
   
   Is it possible to clean old port groups of other networks through any garbage collector, when this setting is true.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-904658555


   > @Spaceman1984 Tested this manually with multiple vSphere hosts (and Standard vSwitches), I noticed the port groups are removed only on one host where the last destroyed VM (usually VR) resides. Make sure the unused port groups are removed from all the hosts. Also, verify this with Distributed vSwitch. Thanks.
   
   Addressed the changes for cleaning up of the unused port groups on all the hosts. Tested this manually with multiple vSphere hosts, network configured through standard vSwitches on them.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-889863970


   @Spaceman1984 Tested this manually with multiple vSphere hosts (and Standard vSwitches), I noticed the port groups are removed only on one host where the last destroyed VM (usually VR) resides. Make sure the unused port groups are removed from all the hosts. Also, verify this with Distributed vSwitch. Thanks.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#discussion_r591248773



##########
File path: plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java
##########
@@ -5732,16 +5733,24 @@ protected Answer execute(UnregisterNicCommand cmd) {
     }
 
     public void cleanupNetwork(HostMO hostMo, NetworkDetails netDetails) {
-        // we will no longer cleanup VLAN networks in order to support native VMware HA

Review comment:
       As per the comment here, native VMware HA not supported when the setting "vmware.cleanup.port.groups" is true, right? If so, may be you can add this as a WARNING in the config description.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-781288669


   @Spaceman1984 a Trillian-Jenkins test job (centos7 mgmt + vmware-67u3) has been kicked to run smoke tests


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-781693700


   <b>Trillian test result (tid-3570)</b>
   Environment: vmware-67u3 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 38865 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4701-t3570-vmware-67u3.zip
   Intermittent failure detected: /marvin/tests/smoke/test_kubernetes_clusters.py
   Smoke tests completed. 85 look OK, 1 have error(s)
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_03_deploy_and_upgrade_kubernetes_cluster | `Failure` | 776.06 | test_kubernetes_clusters.py
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] nvazquez commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
nvazquez commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-907385358


   @blueorangutan test centos7 vmware-67u3


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] nvazquez commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
nvazquez commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-866925091


   Hi @Spaceman1984 there are some open questions on this PR, can you please advise?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] Spaceman1984 commented on a change in pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
Spaceman1984 commented on a change in pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#discussion_r592195937



##########
File path: plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java
##########
@@ -5732,16 +5733,24 @@ protected Answer execute(UnregisterNicCommand cmd) {
     }
 
     public void cleanupNetwork(HostMO hostMo, NetworkDetails netDetails) {
-        // we will no longer cleanup VLAN networks in order to support native VMware HA
-        /*
-         * assert(netDetails.getName() != null); try { synchronized(this) { NetworkMO networkMo = new
-         * NetworkMO(hostMo.getContext(), netDetails.getNetworkMor()); ManagedObjectReference[] vms =
-         * networkMo.getVMsOnNetwork(); if(vms == null || vms.length == 0) { if(s_logger.isInfoEnabled()) {
-         * s_logger.info("Cleanup network as it is currently not in use: " + netDetails.getName()); }
-         *
-         * hostMo.deletePortGroup(netDetails.getName()); } } } catch(Throwable e) {
-         * s_logger.warn("Unable to cleanup network due to exception, skip for next time"); }
-         */
+        if (!VmwareManager.s_vmwareCleanupPortGroups.value()){
+            return;
+        }
+        assert(netDetails.getName() != null);
+        try {
+            synchronized(this) {
+                NetworkMO networkMo = new NetworkMO(hostMo.getContext(), netDetails.getNetworkMor());
+                List<ManagedObjectReference> vms = networkMo.getVMsOnNetwork();
+                if(vms == null || vms.size() == 0) {

Review comment:
       Addressed




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-904679117


   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 997


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-904656993


   @sureshanaparti a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on a change in pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#discussion_r595775182



##########
File path: plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/manager/VmwareManager.java
##########
@@ -46,6 +46,9 @@
     static final ConfigKey<Integer> s_vmwareOVAPackageTimeout = new ConfigKey<Integer>(Integer.class, "vmware.package.ova.timeout", "Advanced", "3600",
             "Vmware script timeout for ova packaging process", true, ConfigKey.Scope.Global, 1000);
 
+    static final ConfigKey<Boolean> s_vmwareCleanupPortGroups = new ConfigKey<Boolean>("Advanced", Boolean.class, "vmware.cleanup.port.groups",  "false",
+            "Remove unused port groups. WARNING: When set to true, native VMware HA might not work.", true, ConfigKey.Scope.Global);

Review comment:
       @Spaceman1984 If my understanding is correct, cleanup port groups happens only on the network cleanup only and the old uncleaned port groups of other networks (when this setting is false) still remains. If so, Can you mention in the setting description that port groups cleanup happens on the network cleanup for that network only.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] nvazquez commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
nvazquez commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-886851839


   @blueorangutan test centos7 vmware-67u3


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-907385784


   @nvazquez a Trillian-Jenkins test job (centos7 mgmt + vmware-67u3) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] GutoVeronezi commented on a change in pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
GutoVeronezi commented on a change in pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#discussion_r590623687



##########
File path: plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java
##########
@@ -5732,16 +5733,24 @@ protected Answer execute(UnregisterNicCommand cmd) {
     }
 
     public void cleanupNetwork(HostMO hostMo, NetworkDetails netDetails) {
-        // we will no longer cleanup VLAN networks in order to support native VMware HA
-        /*
-         * assert(netDetails.getName() != null); try { synchronized(this) { NetworkMO networkMo = new
-         * NetworkMO(hostMo.getContext(), netDetails.getNetworkMor()); ManagedObjectReference[] vms =
-         * networkMo.getVMsOnNetwork(); if(vms == null || vms.length == 0) { if(s_logger.isInfoEnabled()) {
-         * s_logger.info("Cleanup network as it is currently not in use: " + netDetails.getName()); }
-         *
-         * hostMo.deletePortGroup(netDetails.getName()); } } } catch(Throwable e) {
-         * s_logger.warn("Unable to cleanup network due to exception, skip for next time"); }
-         */
+        if (!VmwareManager.s_vmwareCleanupPortGroups.value()){
+            return;
+        }
+        assert(netDetails.getName() != null);
+        try {
+            synchronized(this) {
+                NetworkMO networkMo = new NetworkMO(hostMo.getContext(), netDetails.getNetworkMor());
+                List<ManagedObjectReference> vms = networkMo.getVMsOnNetwork();
+                if(vms == null || vms.size() == 0) {
+                    if(s_logger.isInfoEnabled()) {
+                        s_logger.info("Cleanup network as it is currently not in use: " + netDetails.getName());
+                    }
+                    hostMo.deletePortGroup(netDetails.getName());
+                }
+            }
+        } catch(Throwable e) {
+            s_logger.warn("Unable to cleanup network due to exception, skip for next time");

Review comment:
       Suggestion:
   Add the var `e` as last param of `warn`, it will improve troubleshoting.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-796610105


   Packaging result: :heavy_check_mark: centos7 :heavy_check_mark: centos8 :heavy_check_mark: debian. SL-JID 88


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-883150181






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-883177835


   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian. SL-JID 594


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-907579485


   <b>Trillian test result (tid-1817)</b>
   Environment: vmware-67u3 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 37999 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4701-t1817-vmware-67u3.zip
   Smoke tests completed. 89 look OK, 0 have error(s)
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-886796613


   @nvazquez a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] Spaceman1984 commented on a change in pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
Spaceman1984 commented on a change in pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#discussion_r657650015



##########
File path: plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/manager/VmwareManager.java
##########
@@ -46,6 +46,9 @@
     static final ConfigKey<Integer> s_vmwareOVAPackageTimeout = new ConfigKey<Integer>(Integer.class, "vmware.package.ova.timeout", "Advanced", "3600",
             "Vmware script timeout for ova packaging process", true, ConfigKey.Scope.Global, 1000);
 
+    static final ConfigKey<Boolean> s_vmwareCleanupPortGroups = new ConfigKey<Boolean>("Advanced", Boolean.class, "vmware.cleanup.port.groups",  "false",
+            "Remove unused port groups. WARNING: When set to true, native VMware HA might not work.", true, ConfigKey.Scope.Global);

Review comment:
       To my knowledge, this setting is not used through garbage collection, it is checked when an instance is destroyed. I'm not sure if there is some kind of garbage collection that would destroy a VR, if there is, then I suppose this will also apply.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] nvazquez commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
nvazquez commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-886795918


   @blueorangutan package 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] nvazquez commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
nvazquez commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-884853966


   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] DaanHoogland commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-797320059


   code looks good @Spaceman1984 , but i don't see how it is being called. Am I missing something?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-887172482


   <b>Trillian test result (tid-1380)</b>
   Environment: vmware-67u3 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 36550 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4701-t1380-vmware-67u3.zip
   Intermittent failure detected: /marvin/tests/smoke/test_pvlan.py
   Smoke tests completed. 88 look OK, 1 have error(s)
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_create_pvlan_network | `Error` | 0.03 | test_pvlan.py
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] nvazquez commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
nvazquez commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-907355360


   Conflicts fixed
   
   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] Spaceman1984 commented on a change in pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
Spaceman1984 commented on a change in pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#discussion_r657650015



##########
File path: plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/manager/VmwareManager.java
##########
@@ -46,6 +46,9 @@
     static final ConfigKey<Integer> s_vmwareOVAPackageTimeout = new ConfigKey<Integer>(Integer.class, "vmware.package.ova.timeout", "Advanced", "3600",
             "Vmware script timeout for ova packaging process", true, ConfigKey.Scope.Global, 1000);
 
+    static final ConfigKey<Boolean> s_vmwareCleanupPortGroups = new ConfigKey<Boolean>("Advanced", Boolean.class, "vmware.cleanup.port.groups",  "false",
+            "Remove unused port groups. WARNING: When set to true, native VMware HA might not work.", true, ConfigKey.Scope.Global);

Review comment:
       To my knowledge, this setting is not used through garbage collection, it is checked when an instance is destroyed.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-883190507


   @Spaceman1984 a Trillian-Jenkins test job (centos7 mgmt + vmware-67u3) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] Spaceman1984 closed pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
Spaceman1984 closed pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] rhtyd commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
rhtyd commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-895050972


   @sureshanaparti @andrijapanicsb @borisstoyanov @vladimirpetrov @nvazquez are we lgtm to merge this?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-907369845


   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian :heavy_check_mark: suse15. SL-JID 1044


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-781277615


   Packaging result: ✔centos7 ✔centos8 ✔debian. JID-2735


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] DaanHoogland commented on a change in pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
DaanHoogland commented on a change in pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#discussion_r657731148



##########
File path: plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java
##########
@@ -5732,16 +5733,24 @@ protected Answer execute(UnregisterNicCommand cmd) {
     }
 
     public void cleanupNetwork(HostMO hostMo, NetworkDetails netDetails) {
-        // we will no longer cleanup VLAN networks in order to support native VMware HA
-        /*
-         * assert(netDetails.getName() != null); try { synchronized(this) { NetworkMO networkMo = new
-         * NetworkMO(hostMo.getContext(), netDetails.getNetworkMor()); ManagedObjectReference[] vms =
-         * networkMo.getVMsOnNetwork(); if(vms == null || vms.length == 0) { if(s_logger.isInfoEnabled()) {
-         * s_logger.info("Cleanup network as it is currently not in use: " + netDetails.getName()); }
-         *
-         * hostMo.deletePortGroup(netDetails.getName()); } } } catch(Throwable e) {
-         * s_logger.warn("Unable to cleanup network due to exception, skip for next time"); }
-         */
+        if (!VmwareManager.s_vmwareCleanupPortGroups.value()){
+            return;
+        }
+        assert(netDetails.getName() != null);

Review comment:
       assert is not fine as it will either not run in production (as assertions are disabled) or it will exit the server immediately. Why is this here?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] Spaceman1984 commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
Spaceman1984 commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-883150020


   @blueorangutan package


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-883150181






-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] Spaceman1984 commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
Spaceman1984 commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-867361421


   > code looks good @Spaceman1984 , but i don't see how it is being called. Am I missing something?
   
   This setting is checked when an instance is destroyed @DaanHoogland. If the instance being destroyed is the last instance using a specific network, the port group will be removed.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] nvazquez commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
nvazquez commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-884892367


   @blueorangutan test centos7 vmware-67u3


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] sureshanaparti commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
sureshanaparti commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-904681209


   @blueorangutan test centos7 vmware-67u3


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-886823156


   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian. SL-JID 654


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-886852633


   @nvazquez a Trillian-Jenkins test job (centos7 mgmt + vmware-67u3) has been kicked to run smoke tests


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] blueorangutan commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
blueorangutan commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-884866905


   Packaging result: :heavy_check_mark: el7 :heavy_check_mark: el8 :heavy_check_mark: debian. SL-JID 629


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [cloudstack] Spaceman1984 commented on pull request #4701: Added support for removing unused port groups on VMWare

Posted by GitBox <gi...@apache.org>.
Spaceman1984 commented on pull request #4701:
URL: https://github.com/apache/cloudstack/pull/4701#issuecomment-796597153


   @blueorangutan package


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org