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 2020/10/12 18:21:57 UTC

[GitHub] [cloudstack] GabrielBrascher opened a new pull request #4397: List VMs by Security Group & HA

GabrielBrascher opened a new pull request #4397:
URL: https://github.com/apache/cloudstack/pull/4397


   ## Description
   <!--- Describe your changes in detail -->
   List VMs by "security group ID" and/or "ha enabled"
   
   Improve List VMs command allowing to list VMs filtering by security group or HA enabled.
   <!-- 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: # -->
   
   ## Types of changes
   <!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
   - [ ] Breaking change (fix or feature that would cause existing functionality to change)
   - [ ] New feature (non-breaking change which adds functionality)
   - [ ] 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)
   
   ## 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. -->
   List VMs via API with different combinations. All worked fine.
   - filter vms with security group ID
   `list virtualmachines filter=id,name,haenable,securitygroup listall=true securitygroupid=<SG UUID>`
   
   - list VMs according to the HA enabled
   `list virtualmachines filter=id,name,haenable,securitygroup listall=true haenable=true`
   `list virtualmachines filter=id,name,haenable,securitygroup listall=true haenable=false`
   
   - combione both added parameters
   `list virtualmachines filter=id,name,haenable,securitygroup listall=true haenable=false securitygroupid=<SG UUID>`
   `list virtualmachines filter=id,name,haenable,securitygroup listall=true haenable=true securitygroupid=<SG UUID>`
   `list virtualmachines filter=id,name,haenable,securitygroup listall=true haenable=false securitygroupid=<SG UUID2>`
   `list virtualmachines filter=id,name,haenable,securitygroup listall=true haenable=true securitygroupid=<SG UUID2>`
   
   <!-- 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] blueorangutan commented on pull request #4397: List VMs by Security Group & HA

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


   @GabrielBrascher 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] DaanHoogland commented on pull request #4397: List VMs by Security Group & HA

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


   Are you talking about @Pearl1594 's comment @wido ? (affinity group affinity ;)


----------------------------------------------------------------
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 pull request #4397: List VMs by Security Group & HA

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


   np @GabrielBrascher thanks for the quick response


----------------------------------------------------------------
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 #4397: List VMs by Security Group & HA

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


   <b>Trillian test result (tid-2932)</b>
   Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
   Total time taken: 37369 seconds
   Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4397-t2932-kvm-centos7.zip
   Intermittent failure detected: /marvin/tests/smoke/test_vpc_redundant.py
   Intermittent failure detected: /marvin/tests/smoke/test_hostha_kvm.py
   Smoke tests completed. 83 look OK, 2 have error(s)
   Only failed tests results shown below:
   
   
   Test | Result | Time (s) | Test File
   --- | --- | --- | ---
   test_03_create_redundant_VPC_1tier_2VMs_2IPs_2PF_ACL_reboot_routers | `Failure` | 295.16 | test_vpc_redundant.py
   test_hostha_kvm_host_fencing | `Error` | 98.88 | test_hostha_kvm.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] DaanHoogland merged pull request #4397: List VMs by Security Group & HA

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


   


----------------------------------------------------------------
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] GabrielBrascher commented on pull request #4397: List VMs by Security Group & HA

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


   @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] GabrielBrascher commented on pull request #4397: List VMs by Security Group & HA

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


   My mistake @DaanHoogland @Pearl1594 @sureshanaparti. Should we revert this commit?


----------------------------------------------------------------
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] GabrielBrascher commented on a change in pull request #4397: List VMs by Security Group & HA

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



##########
File path: server/src/main/java/com/cloud/api/query/QueryManagerImpl.java
##########
@@ -1016,10 +1024,18 @@
             sc.setParameters("serviceOfferingId", serviceOffId);
         }
 
+        if(securityGroupId != null) {
+            sc.setParameters("securityGroupId", securityGroupId);
+        }
+
         if (display != null) {
             sc.setParameters("display", display);
         }
 
+        if (display != null) {

Review comment:
       The code has been updated addressing both comments. Thanks for the review @Pearl1594 and @sureshanaparti.




----------------------------------------------------------------
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 pull request #4397: List VMs by Security Group & HA

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


   @blueorangutan test


----------------------------------------------------------------
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 #4397: List VMs by Security Group & HA

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


   @DaanHoogland seems affinityGroupId code is accidentally removed. As this PR changes impacting existing func, better revert and fix that, and merge it again.


----------------------------------------------------------------
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] wido commented on pull request #4397: List VMs by Security Group & HA

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


   LGTM based on code


----------------------------------------------------------------
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] GabrielBrascher commented on pull request #4397: List VMs by Security Group & HA

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


   @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] sureshanaparti edited a comment on pull request #4397: List VMs by Security Group & HA

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


   @DaanHoogland seems affinityGroupId code is accidentally removed. As this PR changes impacting existing func, better revert and fix that, and merge it again. Otherway should be also ok, if immediate fix.


----------------------------------------------------------------
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 #4397: List VMs by Security Group & HA

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



##########
File path: server/src/main/java/com/cloud/api/query/QueryManagerImpl.java
##########
@@ -1016,10 +1024,18 @@
             sc.setParameters("serviceOfferingId", serviceOffId);
         }
 
+        if(securityGroupId != null) {

Review comment:
       ```suggestion
           if (securityGroupId != null) {
   ```




----------------------------------------------------------------
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 #4397: List VMs by Security Group & HA

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



##########
File path: server/src/main/java/com/cloud/api/query/QueryManagerImpl.java
##########
@@ -1016,10 +1024,18 @@
             sc.setParameters("serviceOfferingId", serviceOffId);
         }
 
+        if(securityGroupId != null) {
+            sc.setParameters("securityGroupId", securityGroupId);
+        }
+
         if (display != null) {
             sc.setParameters("display", display);
         }
 
+        if (display != null) {

Review comment:
       good catch @Pearl1594 




----------------------------------------------------------------
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] wido commented on pull request #4397: List VMs by Security Group & HA

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


   Indeed @DaanHoogland, I quoted the wrong person. I meant @Pearl1594 his comment indeed.


----------------------------------------------------------------
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 #4397: List VMs by Security Group & HA

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


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


----------------------------------------------------------------
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] GabrielBrascher commented on pull request #4397: List VMs by Security Group & HA

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


   @DaanHoogland @sureshanaparti @Pearl1594 @wido I have created PR #4405 addressing the removed affinity group ID.
   
   I am sorry for all the trouble, guys. This was the first time that I messed this big with a PR.
   I really appreciate all the reviews and heads up!


----------------------------------------------------------------
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 #4397: List VMs by Security Group & HA

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


   @DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) 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] wido commented on pull request #4397: List VMs by Security Group & HA

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


   Very valid comment from @sureshanaparti ! @GabrielBrascher Can you elaborate on that?


----------------------------------------------------------------
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 #4397: List VMs by Security Group & HA

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


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


----------------------------------------------------------------
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 #4397: List VMs by Security Group & HA

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


   @GabrielBrascher 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] DaanHoogland commented on pull request #4397: List VMs by Security Group & HA

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


   revert or fix forward @GabrielBrascher your choice for my part,, but with priority please.


----------------------------------------------------------------
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 pull request #4397: List VMs by Security Group & HA

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


   @GabrielBrascher indeed please advice. As per enough 👍 and test effort I merged but overlooked @Pearl1594 's question. Should we revert or fix forward or is there a legitimate explanation to the answer the query? (cc @wido , @sureshanaparti )


----------------------------------------------------------------
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] Pearl1594 commented on a change in pull request #4397: List VMs by Security Group & HA

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



##########
File path: server/src/main/java/com/cloud/api/query/QueryManagerImpl.java
##########
@@ -1016,10 +1024,18 @@
             sc.setParameters("serviceOfferingId", serviceOffId);
         }
 
+        if(securityGroupId != null) {
+            sc.setParameters("securityGroupId", securityGroupId);
+        }
+
         if (display != null) {
             sc.setParameters("display", display);
         }
 
+        if (display != null) {

Review comment:
       @GabrielBrascher I guess this is supposed to be isHaEnabled != null ?




----------------------------------------------------------------
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