Skip to content

Conversation

@GaOrtiga
Copy link
Contributor

@GaOrtiga GaOrtiga commented Apr 5, 2023

Description

By utilizing the restartNetwork API and setting the makeredundant parameter to true, ACS allows the user to make a guest network redundant during its restart process; however, this feature was only available through the API.
An adjustment was made to add this functionality to the UI.

Types of changes

  • 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)
  • 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
  • Minor

Screenshots (if appropriate):

image

@GaOrtiga GaOrtiga changed the title redundant networks Enable defining a network as redundant during restart through the UI. Apr 5, 2023
@GaOrtiga GaOrtiga changed the title Enable defining a network as redundant during restart through the UI. Enable defining a network as redundant during restart through the UI Apr 5, 2023
@sonarqubecloud
Copy link

sonarqubecloud bot commented Apr 5, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@codecov
Copy link

codecov bot commented Apr 5, 2023

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 3.57%. Comparing base (5bf869c) to head (92b08e9).
⚠️ Report is 30 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (5bf869c) and HEAD (92b08e9). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (5bf869c) HEAD (92b08e9)
unittests 1 0
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #7405       +/-   ##
============================================
- Coverage     17.51%   3.57%   -13.95%     
============================================
  Files          5914     446     -5468     
  Lines        529867   37731   -492136     
  Branches      64722    6959    -57763     
============================================
- Hits          92782    1347    -91435     
+ Misses       426635   36218   -390417     
+ Partials      10450     166    -10284     
Flag Coverage Δ
uitests 3.57% <ø> (-0.02%) ⬇️
unittests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@DaanHoogland
Copy link
Contributor

@GaOrtiga i think this was removed from the UI on purpose. I don´t mind either way but it seems to me operators want to have control on whether users are allowed to make this mistake (as i understood it).

@DaanHoogland
Copy link
Contributor

code lgtm btw

@borisstoyanov
Copy link
Contributor

exactly, tbh I'm against this api option to exist at all since whether redundant or not should be defined in the offering not as a single action

@GaOrtiga
Copy link
Contributor Author

GaOrtiga commented Apr 6, 2023

@GaOrtiga i think this was removed from the UI on purpose. I don´t mind either way but it seems to me operators want to have control on whether users are allowed to make this mistake (as i understood it).

I understand, however, users already can do this through the API; therefore, operators don't fully control it. Also, for VPCs this option exists in the UI while restarting them.
I see @borisstoyanov's point on redundant being a feature defined on the offering, however, the discussion would be outside of the PR's scope; could we create an issue or a thread on the mail-list to discuss the make redundant feature (for both VPC and guest networks)?

Copy link
Member

@weizhouapache weizhouapache left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I know, some users wanted to disable this on UI, but some others want this.
As a compromise, can we enable it only for root admin ? if users want it to be visible for domain admins or regular users, create a new network offering and do it through network update with the new network offering.

@GaOrtiga
Copy link
Contributor Author

As far as I know, some users wanted to disable this on UI, but some others want this. As a compromise, can we enable it only for root admin ? if users want it to be visible for domain admins or regular users, create a new network offering and do it through network update with the new network offering.

We could also apply these changes to the UI to maintain consistence with the VPCs section and provide an option in the backend that lets admins determine whether or not to allow users to have access to this. This would standardize the code and address both issues. What are your thoughts on this? If you guys agree on that, we can move with this PR as is, and then create a new one to introduce this other featureset into ACS.

@DaanHoogland
Copy link
Contributor

As far as I know, some users wanted to disable this on UI, but some others want this. As a compromise, can we enable it only for root admin ? if users want it to be visible for domain admins or regular users, create a new network offering and do it through network update with the new network offering.

We could also apply these changes to the UI to maintain consistence with the VPCs section and provide an option in the backend that lets admins determine whether or not to allow users to have access to this. This would standardize the code and address both issues. What are your thoughts on this? If you guys agree on that, we can move with this PR as is, and then create a new one to introduce this other featureset into ACS.

I agree with the addition that disabling it in the backend should also remove the option on the UI.

@weizhouapache
Copy link
Member

what's your opinions ?
cc @rohityadavcloud @alexandremattioli @andrijapanicsb @NuxRo

@andrijapanicsb
Copy link
Contributor

There were a lot of cases where people have "accidentally" switched this on and didn't know the consequences, so... not sure what is the best way forward.

@yadvr
Copy link
Member

yadvr commented May 8, 2023

Sorry -1, we had a conversation in the past. In fact this feature never had existed, until I had put it in. After discussions and feedback from users esp service providers, we decided to remove the option from the UI though the API param may still be available via UI. This is because service providers may have an explicit network offering with redundant routers, users without using/paying for one could this form to circumvent to get redundant routers for a network not intended for them.

However, there is a middle ground but probably not necessary - it could be via adding a global setting for operators to decide if they want to enable such a feature for end users. (listCapabilities or other means can export this option to the UI to show/hide such a setting).

@weizhouapache
Copy link
Member

@GaOrtiga
it seems difficult to get a consensus.

will you consider a new global setting to manage it ? (requires UI, API and service layer changes)

@weizhouapache weizhouapache marked this pull request as draft May 12, 2023 07:44
@weizhouapache weizhouapache marked this pull request as ready for review May 12, 2023 07:45
@DaanHoogland DaanHoogland added this to the 4.19.0.0 milestone Jun 22, 2023
@GaOrtiga
Copy link
Contributor Author

There were a lot of cases where people have "accidentally" switched this on and didn't know the consequences, so... not sure what is the best way forward.

We could add a warning message explaining the consequences when that option is selected

Sorry -1, we had a conversation in the past. In fact this feature never had existed, until I had put it in. After discussions and feedback from users esp service providers, we decided to remove the option from the UI though the API param may still be available via UI. This is because service providers may have an explicit network offering with redundant routers, users without using/paying for one could this form to circumvent to get redundant routers for a network not intended for them.

However, there is a middle ground but probably not necessary - it could be via adding a global setting for operators to decide if they want to enable such a feature for end users. (listCapabilities or other means can export this option to the UI to show/hide such a setting).

They can still do the same process using the API, so adding this to the UI would not make a difference in that case.

As for the global setting, I do agree that is a good option, however it would fall out of the scope of this PR. And I still believe we should make these changes in order to keep consistence between the UI and the API, regardless of the addition of a global setting.

@DaanHoogland
Copy link
Contributor

@GaOrtiga how do you want to move forward with this? (moving it to 4.20 for now)

@DaanHoogland DaanHoogland modified the milestones: 4.19.0.0, 4.20.0.0 Oct 31, 2023
Copy link
Member

@yadvr yadvr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't accept this because (a) this was reverted after several service providers and users complaint that they don't want users to have rvr when the offering doesn't allow that by default, (b) isn't aligned with the original use-case. So, while the API may still allow for it, we don't necessarily want to expose that via UI.

@yadvr
Copy link
Member

yadvr commented Nov 3, 2023

@GaOrtiga the only way could be to introduce a feature flag in config.json (in UI) and have it disabled by default, when enabled you can pass the options in UI to show the elements. Could you review if this approach works for your use-case or close the PR. Thanks.

@andrijapanicsb
Copy link
Contributor

Agree with what Rohit said, this was enabled some releases ago, and it created issues for the Operators. It should be "impossible" by default, with the option to make it configured/enabled if the operator really needs it.

@alexandremattioli
Copy link
Contributor

-1 on adding this to the UI. Until the fundamental issues with VRRP are solved this feature should be avoided at all costs.

@NuxRo
Copy link
Contributor

NuxRo commented Nov 9, 2023

Agree with what Rohit said, this was enabled some releases ago, and it created issues for the Operators. It should be "impossible" by default, with the option to make it configured/enabled if the operator really needs it.

+1 what Andrija said. Not against having the feature, but let's make it depend on a global option or something, or a network offering like @borisstoyanov suggested.
We should the same feature that exists in a VPC as well to be honest.

@sureshanaparti
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 13632

@DaanHoogland
Copy link
Contributor

@JoaoJandre do you still want this (behind a feature flag)?

@JoaoJandre
Copy link
Contributor

@JoaoJandre do you still want this (behind a feature flag)?

As long as the default value for the config is true, to maintain the same behavior as the older versions, I'm fine with it.

@DaanHoogland
Copy link
Contributor

@JoaoJandre do you still want this (behind a feature flag)?

As long as the default value for the config is true, to maintain the same behavior as the older versions, I'm fine with it.

@GaOrtiga will you implement such a flag?

@GaOrtiga GaOrtiga force-pushed the redundant_network_via_UI branch from 969cd89 to cc7eb93 Compare January 6, 2026 17:13
@GaOrtiga
Copy link
Contributor Author

GaOrtiga commented Jan 6, 2026

@DaanHoogland I added the config

@rajujith rajujith moved this to In Progress in Apache CloudStack 4.22.1 Jan 7, 2026
@DaanHoogland DaanHoogland requested a review from yadvr January 7, 2026 07:35
@DaanHoogland
Copy link
Contributor

@DaanHoogland I added the config

thanks @GaOrtiga . @andrijapanicsb @yadvr , can you concur with this solution?

User callerUser = _accountMgr.getActiveUser(CallContext.current().getCallingUserId());
if (makeRedundant && !_accountMgr.isRootAdmin(callerUser.getAccountId()) && !AllowUsersToMakeNetworksRedundant.value() ) {
throw new InvalidParameterValueException(String.format("Could not make network redundant as calling user is not Root Admin and [%s] is set to false.",
AllowUsersToMakeNetworksRedundant.key()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
AllowUsersToMakeNetworksRedundant.key()));

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sureshanaparti , this is a syntax error. I think I know what you mean, but let’s not apply this.

Co-authored-by: Suresh Kumar Anaparti <sureshkumar.anaparti@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.