Skip to content

Introducing concept of domain VPCs - #7153

Merged
DaanHoogland merged 9 commits into
apache:mainfrom
scclouds:domain_vpcs
Jul 29, 2023
Merged

Introducing concept of domain VPCs#7153
DaanHoogland merged 9 commits into
apache:mainfrom
scclouds:domain_vpcs

Conversation

@GaOrtiga

@GaOrtigaGaOrtiga commented Jan 31, 2023

Copy link
Copy Markdown
Collaborator

In ACS the creation of tiers of a VPC is restricted to the same account that owns the VPC; therefore, each account needs to have its own VPC and it is not possible to group tiers owned by different accounts in the same VPC. These tiers cannot share the same VR that is used to implement the VPC, for instance.

However, in private cloud scenarios to reduce the number of VRs, it might be interesting to have VPCs, where its tiers are owned by different accounts; thus, they (the accounts) share the same VR/VPC, but each one has their own broadcast domain and features implemented by the VPC, such as DHCP, NAT, and so on.

To address this situation, the concept of Domain VPCs has been created (only available on the API so far), where a VPC can be managed by a domain and its tiers can be created to accounts inside the domain. In the createNetwork API it will be possible to create networks (tiers) to a VPC from a different account; however, the target account must be accessible for the account that owns the VPC. The tiers will be isolated from the broadcast domain and will consume the same VR, in accordance with the current behavior. Also, if a VPN is setup in the VPC, the user will have access to all networks, in accordance with the current behavior.

Documentation: apache/cloudstack-documentation#410

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

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

How Has This Been Tested?

I created VPCs with Root Admin, Domain Admin, and user accounts and tried creating tiers in these VPCs for the other accounts (should only be able to create if the VPC account has access to the account that owns the network).

#VPC owner accountNetwork Owner accountSame DomainCould CreateExpected Result
1Root AdminAnyAnyYY
2Domain AdminAnyNNY
3Domain AdminAnyYYY
4UserSame UserYYY
5UserAny OtherAnyNY

I also ran some basic tests like deploying VMs in the created networks and checking that the networks were working properly.

@GaOrtigaGaOrtiga changed the title Implementation of Domain VPCsDraft: Implementation of Domain VPCsJan 31, 2023
@GaOrtigaGaOrtiga changed the title Draft: Implementation of Domain VPCsImplementation of Domain VPCsJan 31, 2023
@GaOrtiga
GaOrtiga marked this pull request as draft January 31, 2023 17:56
@codecov

codecovBot commented Jan 31, 2023

Copy link
Copy Markdown

Codecov Report

Merging #7153 (32e342d) into main (5975ea8) will increase coverage by 0.13%.
Report is 53 commits behind head on main.
The diff coverage is 14.28%.

@@ Coverage Diff @@## main #7153 +/- ##
============================================
+ Coverage 13.37% 13.50% +0.13% - Complexity 9320 9731 +411 
============================================
Files 2740 2747 +7 Lines 258249 266509 +8260 Branches 40235 43764 +3529 ============================================
+ Hits 34537 35990 +1453 - Misses 219354 225914 +6560 - Partials 4358 4605 +247 
Files ChangedCoverage Δ
.../src/main/java/com/cloud/vm/dao/UserVmDaoImpl.java0.74% <0.00%> (-0.02%)⬇️
...src/main/java/com/cloud/api/ApiResponseHelper.java3.78% <0.00%> (-0.01%)⬇️
...n/java/com/cloud/network/IpAddressManagerImpl.java2.90% <0.00%> (ø)
...loud/network/lb/LoadBalancingRulesManagerImpl.java7.87% <0.00%> (ø)
...ain/java/com/cloud/network/vpc/VpcManagerImpl.java9.64% <50.00%> (+0.27%)⬆️

... and 64 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@GaOrtigaGaOrtiga changed the title Implementation of Domain VPCsIntroducing concept of domain VPCsJan 31, 2023
@GaOrtiga
GaOrtiga marked this pull request as ready for review January 31, 2023 20:45

@DaanHooglandDaanHoogland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks good, I recommend extensive manual testing as un foreseen consequences may come from this concept. The change is simple enough and is great if it turns out it works out of the box.

Comment threadserver/src/main/java/com/cloud/api/ApiResponseHelper.java Outdated
@GaOrtiga
GaOrtiga marked this pull request as draft February 7, 2023 18:07
Comment threadserver/src/main/java/com/cloud/network/IpAddressManagerImpl.java Outdated
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@sonarqubecloud

Copy link
Copy Markdown

Comment threadserver/src/main/java/com/cloud/api/ApiResponseHelper.java Outdated
Comment threadserver/src/main/java/com/cloud/network/IpAddressManagerImpl.java Outdated
Comment threadserver/src/main/java/com/cloud/network/vpc/VpcManagerImpl.java Outdated
@github-actions

Copy link
Copy Markdown

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@kiranchavalakiranchavala left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@GaOrtiga

what about the scenario where the network account owner is a user account in the same domain?

Ideally the network should get created since the user is present in the same domain

VPC owner accountNetwork Owner accountSame DomainCould CreateExpected ResultComments
Domain AdminUser (role)YNthe network should get created🙈 Error: (HTTP 531, error code 4365) Account [{"accountName":"<>r","id":6,"uuid":"9d9daf47-04be-4488-af71-281e255fedfe"}] does not have permission to operate with resource

@kiranchavalakiranchavala left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@GaOrtiga

Another scenario where sub domains are present

Also, what will happen if an account is present under a sub domains of a domain

Ideally, the network should get created since the subdomain is also falls under the same domain

VPC owner accountNetwork Owner accountSame DomainCould CreateExpected ResultComments
Domain AdminAccount under a subdomainYNNetwork tier should get created🙈 Error: (HTTP 531, error code 4365) Account <>does not have permission to operate within domain id=51427f97-6c38-4a7d-bf1c-8cdc86232cb8

@apacheapache deleted a comment from blueorangutanJul 14, 2023
@apacheapache deleted a comment from blueorangutanJul 14, 2023
@apacheapache deleted a comment from blueorangutanJul 14, 2023
@GaOrtiga

Copy link
Copy Markdown
CollaboratorAuthor

@GaOrtiga

Another scenario where sub domains are present

Also, what will happen if an account is present under a sub domains of a domain

Ideally, the network should get created since the subdomain is also falls under the same domain
VPC owner account Network Owner account Same Domain Could Create Expected Result Comments
Domain Admin Account under a subdomain Y N Network tier should get created see_no_evil Error: (HTTP 531, error code 4365) Account <>does not have permission to operate within domain id=51427f97-6c38-4a7d-bf1c-8cdc86232cb8

hi @kiranchavala thanks for testing.

Which account did you use to run the API commands?

I ran both tests twice, once using the VPC owner and the other using the network owner. While running it with the VPC owner, both creations were successful. When running it with network owner I had the same results as you, however I do believe this is the correct outcome, since these accounts should not be able to access the the domain admin's resources such as the VPC.

@kiranchavala

Copy link
Copy Markdown
Member

Hi @GaOrtiga

Thanks for the update

I used the network owner account to execute the api calls

Also Let me do a quick check with the VPC owner account

@apacheapache deleted a comment from blueorangutanJul 18, 2023

@kiranchavalakiranchavala left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@GaOrtiga

I have tested manually the combinations specified with the table with the VPC owner account credentials and they work fine

#VPC owner accountNetwork Owner accountSame DomainCould CreateExpected Result
1Root AdminAnyAnyYY
2Domain AdminAnyNNY
3Domain AdminAnyYYY
4UserSame UserYYY
5UserAny OtherAnyNY

@kiranchavalakiranchavala left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, tested manually the combinations specified with the table with the VPC owner account credentials and they work fine

#VPC owner accountNetwork Owner accountSame DomainCould CreateExpected Result
1Root AdminAnyAnyYY
2Domain AdminAnyNNY
3Domain AdminAnyYYY
4UserSame UserYYY
5UserAny OtherAnyNY

Also tested by launching vm in different tiers belonging to different account and the communication between them was working fine

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a [SF] 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
Copy Markdown

Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 6593

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a [SF] Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian test result (tid-7197)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 43295 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr7153-t7197-kvm-centos7.zip
Smoke tests completed. 112 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

TestResultTime (s)Test File
test_01_migrate_VM_and_root_volumeError76.63test_vm_life_cycle.py
test_02_migrate_VM_with_two_data_disksError50.28test_vm_life_cycle.py

@DaanHooglandDaanHoogland left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

clgtm

@GaOrtiga

Copy link
Copy Markdown
CollaboratorAuthor

doc PR:
apache/cloudstack-documentation#410

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@GaOrtiga@DaanHoogland@blueorangutan@kiranchavala