You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "bradywilkin (via GitHub)" <gi...@apache.org> on 2025/05/04 21:22:25 UTC

[PR] Completed config option to allow nested virtualization [cloudstack]

bradywilkin opened a new pull request, #10812:
URL: https://github.com/apache/cloudstack/pull/10812

   ### Description
   
   This PR...
   <!--- Describe your changes in DETAIL - And how has behaviour functionally changed. -->
   
   I introduced a new global configuration option, AllowNestedVMAccess, within the IPAddressManagerImpl.java file. This setting is then referenced in LibVirtComputingResource when determining whether the virtualized firewall can be bridged. If the configuration key is enabled, the system returns true for canBridgeFirewall without running security_group.py. As discussed in the issue itself we first wanted to get a functional basic version completed- later on this should include modifications to the script in secuirty_group.py to allow other functionality to occur while still allowing nested VM access.
   
   <!-- For new features, provide link to FS, dev ML discussion etc. -->
   <!-- In case of bug fix, the expected and actual behaviours, steps to reproduce. -->
   
   https://github.com/apache/cloudstack/issues/10286
   
   <!-- 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: # -->
   
   10286
   
   <!--- ******************************************************************************* -->
   <!--- NOTE: AUTOMATION 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)
   - [X] New feature (non-breaking change which adds functionality)
   - [ ] Bug fix (non-breaking change which fixes an issue)
   - [ ] Enhancement (improves an existing feature and functionality)
   - [ ] Cleanup (Code refactoring and cleanup, that may add test cases)
   - [ ] build/CI
   - [ ] test (unit or integration test code)
   
   ### Feature/Enhancement Scale or Bug Severity
   
   #### Feature/Enhancement Scale
   
   - [ ] Major
   - [X] Minor
   
   #### Bug Severity
   
   - [ ] BLOCKER
   - [ ] Critical
   - [ ] Major
   - [ ] 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 -->
   
   I added a test in IPAddressManagerTest.java to ensure that the firewall can be bridged when this setting is enabled. 
   
   #### How did you try to break this feature and the system with this change?
   
   <!-- see how your change affects other areas of the code, etc. -->
   
   <!-- Please read the [CONTRIBUTING](https://github.com/apache/cloudstack/blob/main/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.

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

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


Re: [PR] Completed config option to allow nested virtualization [cloudstack]

Posted by "boring-cyborg[bot] (via GitHub)" <gi...@apache.org>.
boring-cyborg[bot] commented on PR #10812:
URL: https://github.com/apache/cloudstack/pull/10812#issuecomment-2849445060

   Congratulations on your first Pull Request and welcome to the Apache CloudStack community! If you have any issues or are unsure about any anything please check our Contribution Guide (https://github.com/apache/cloudstack/blob/main/CONTRIBUTING.md)
   Here are some useful points:
   - In case of a new feature add useful documentation (raise doc PR at https://github.com/apache/cloudstack-documentation)
   - Be patient and persistent. It might take some time to get a review or get the final approval from the committers.
   - Pay attention to the quality of your code, ensure tests are passing and your PR doesn't have conflicts.
   - Please follow [ASF Code of Conduct](https://github.com/apache/.github/blob/main/.github/CODE_OF_CONDUCT.md) for all communication including (but not limited to) comments on Pull Requests, Issues, Mailing list and Slack.
   - Be sure to read the [CloudStack Coding Conventions](https://cwiki.apache.org/confluence/display/CLOUDSTACK/Coding+conventions).
   Apache CloudStack is a community-driven project and together we are making it better 🚀.
   In case of doubts contact the developers at:
   Mailing List: dev@cloudstack.apache.org (https://cloudstack.apache.org/mailing-lists.html)
   Slack: https://apachecloudstack.slack.com/
   


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


Re: [PR] Completed config option to allow nested virtualization [cloudstack]

Posted by "pavanaravapalli (via GitHub)" <gi...@apache.org>.
pavanaravapalli commented on code in PR #10812:
URL: https://github.com/apache/cloudstack/pull/10812#discussion_r2442528973


##########
server/src/main/java/com/cloud/network/IpAddressManagerImpl.java:
##########
@@ -329,6 +329,9 @@ public class IpAddressManagerImpl extends ManagerBase implements IpAddressManage
 
     public static final ConfigKey<Integer> PUBLIC_IP_ADDRESS_QUARANTINE_DURATION = new ConfigKey<>("Network", Integer.class, "public.ip.address.quarantine.duration",
             "0", "The duration (in minutes) for the public IP address to be quarantined when it is disassociated.", true, ConfigKey.Scope.Domain);
+    
+    public static final ConfigKey<Boolean> AllowNestedVMAccess = new ConfigKey<>("Advanced", Boolean.class, "allow.nested.vm.access",

Review Comment:
   Append the new configKey "AllowNestedVMAccess"  to the list returned by the getConfigKeys() method in IpAddressManagerImpl. Please refer getConfigKeys() method.



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


Re: [PR] Completed config option to allow nested virtualization [cloudstack]

Posted by "sureshanaparti (via GitHub)" <gi...@apache.org>.
sureshanaparti commented on PR #10812:
URL: https://github.com/apache/cloudstack/pull/10812#issuecomment-3894983354

   Hi @bradywilkin can you check the build errors, and outstanding comments. 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


Re: [PR] Completed config option to allow nested virtualization [cloudstack]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #10812:
URL: https://github.com/apache/cloudstack/pull/10812#issuecomment-2850248017

   ## [Codecov](https://app.codecov.io/gh/apache/cloudstack/pull/10812?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   All modified and coverable lines are covered by tests :white_check_mark:
   > Project coverage is 4.00%. Comparing base [(`fd74895`)](https://app.codecov.io/gh/apache/cloudstack/commit/fd74895ad05da991a1ffc809343df8dd427a073b?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to head [(`7821838`)](https://app.codecov.io/gh/apache/cloudstack/commit/7821838d72a8591d47acc644dfc3236f48402d9e?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   > Report is 4 commits behind head on main.
   
   > :exclamation:  There is a different number of reports uploaded between BASE (fd74895) and HEAD (7821838). Click for more details.
   > 
   > <details><summary>HEAD has 1 upload less than BASE</summary>
   >
   >| Flag | BASE (fd74895) | HEAD (7821838) |
   >|------|------|------|
   >|unittests|1|0|
   ></details>
   
   <details><summary>Additional details and impacted files</summary>
   
   
   ```diff
   @@              Coverage Diff              @@
   ##               main   #10812       +/-   ##
   =============================================
   - Coverage     16.40%    4.00%   -12.41%     
   =============================================
     Files          5692      399     -5293     
     Lines        501962    32597   -469365     
     Branches      60791     5783    -55008     
   =============================================
   - Hits          82353     1305    -81048     
   + Misses       410455    31142   -379313     
   + Partials       9154      150     -9004     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/cloudstack/pull/10812/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [uitests](https://app.codecov.io/gh/apache/cloudstack/pull/10812/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `4.00% <ø> (ø)` | |
   | [unittests](https://app.codecov.io/gh/apache/cloudstack/pull/10812/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   </details>
   
   [:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/cloudstack/pull/10812?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


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


Re: [PR] Completed config option to allow nested virtualization [cloudstack]

Posted by "weizhouapache (via GitHub)" <gi...@apache.org>.
weizhouapache commented on code in PR #10812:
URL: https://github.com/apache/cloudstack/pull/10812#discussion_r2073076372


##########
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java:
##########
@@ -4846,6 +4846,8 @@ protected long getMemoryFreeInKBs(Domain dm) throws LibvirtException {
     }
 
     private boolean canBridgeFirewall(final String prvNic) {

Review Comment:
   the method in LibvirtComputingResource are executed on the kvm host (part of cloudstack-agent)
   The host cannot access the database.
   so, this won't work.
   
   a feasible way is, adding a setting to agent.properties



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


Re: [PR] Completed config option to allow nested virtualization [cloudstack]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #10812:
URL: https://github.com/apache/cloudstack/pull/10812#discussion_r2073022262


##########
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java:
##########
@@ -4846,6 +4846,8 @@ protected long getMemoryFreeInKBs(Domain dm) throws LibvirtException {
     }
 
     private boolean canBridgeFirewall(final String prvNic) {
+        if (getAllowNestedVMAccess())
+            return true; // If nested VM is allowed, then we skip call to security group and allow bypassing firewall

Review Comment:
   [nitpick] Consider adding braces around the single-line if statement to enhance readability and reduce potential errors in future modifications.
   ```suggestion
           if (getAllowNestedVMAccess()) {
               return true; // If nested VM is allowed, then we skip call to security group and allow bypassing firewall
           }
   ```



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


Re: [PR] Completed config option to allow nested virtualization [cloudstack]

Posted by "pavanaravapalli (via GitHub)" <gi...@apache.org>.
pavanaravapalli commented on code in PR #10812:
URL: https://github.com/apache/cloudstack/pull/10812#discussion_r2442528973


##########
server/src/main/java/com/cloud/network/IpAddressManagerImpl.java:
##########
@@ -329,6 +329,9 @@ public class IpAddressManagerImpl extends ManagerBase implements IpAddressManage
 
     public static final ConfigKey<Integer> PUBLIC_IP_ADDRESS_QUARANTINE_DURATION = new ConfigKey<>("Network", Integer.class, "public.ip.address.quarantine.duration",
             "0", "The duration (in minutes) for the public IP address to be quarantined when it is disassociated.", true, ConfigKey.Scope.Domain);
+    
+    public static final ConfigKey<Boolean> AllowNestedVMAccess = new ConfigKey<>("Advanced", Boolean.class, "allow.nested.vm.access",

Review Comment:
   @bradywilkin  
   Append the new configKey "AllowNestedVMAccess"  to the list returned by the getConfigKeys() method in IpAddressManagerImpl. Please refer getConfigKeys().



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


Re: [PR] Completed config option to allow nested virtualization [cloudstack]

Posted by "rajujith (via GitHub)" <gi...@apache.org>.
rajujith commented on PR #10812:
URL: https://github.com/apache/cloudstack/pull/10812#issuecomment-3742025688

   @bradywilkin Since this is for the 4.22.1 release, could you retarget the PR to the 4.22 branch?


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