Skip to content

CLOUDSTACK-10109: Enable dedication of public IPs to SSVM and CPVM - #2295

Merged
yadvr merged 3 commits into
apache:masterfrom
shapeblue:systemvmpubliciprange
Jan 6, 2018
Merged

CLOUDSTACK-10109: Enable dedication of public IPs to SSVM and CPVM#2295
yadvr merged 3 commits into
apache:masterfrom
shapeblue:systemvmpubliciprange

Conversation

@nvazquez

@nvazqueznvazquez commented Oct 12, 2017

Copy link
Copy Markdown
Contributor

JIRA Ticket: https://issues.apache.org/jira/browse/CLOUDSTACK-10109

Description

This feature allow admins to dedicate a range of public IP addresses to the SSVM and CPVM, such that they can be subject to specific external firewall rules. The option to dedicate a public IP range to the System VMs (SSVM & CPVM) is added to the createVlanIpRange API method and the UI.

Solution

Global setting 'system.vm.public.ip.reservation.mode.strictness' is added to determine if the use of the system VM reservation is strict (when true) or preferred (false), false by default.
When a range has been dedicated to System VMs, CloudStack should apply IPs from that range to
the public interfaces of the CPVM and the SSVM depending on global setting's value:

  • If the global setting is set to false: then CloudStack will use any unused and unreserved public IP
    addresses for system VMs only when the pool of reserved IPs has been exhausted
  • If the global setting is set to true: then CloudStack will fail to deploy the system VM when the pool
    of reserved IPs has been exhausted, citing the lack of available IPs.

UI Changes

Under Infrastructure -> Zone -> Physical Network -> Public -> IP Ranges, button 'Account' label is refactored to 'Set reservation':

When that button is clicked, dialog displayed is also refactored, including a new checkbox 'System VMs' which indicates if range should be dedicated for CPVM and SSVM, and a note indicating its usage:

When clicking on button for any created range, UI dialog displayed indicates whether IP range is dedicated for system vms or not:

@nvazqueznvazquez self-assigned this Oct 12, 2017
@nvazquez

Copy link
Copy Markdown
ContributorAuthor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-1158

@nvazquez

Copy link
Copy Markdown
ContributorAuthor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

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

@nvazquez

Copy link
Copy Markdown
ContributorAuthor

@borisstoyanov @rhtyd @DaanHoogland

Guys, one issue while porting this feature to 4.11 which was not present on 4.6. In this commit: 37301ed#diff-6adc687ad4a13d4b956fdc638299401bdomain_vlan_map is introduced. When adding a new range on domain, a new entry on domain_vlan_map is created. As IpAddressManagerImpl#fetchNewPublicIp lists non dedicated zone wide vlans, but always returns range corresponding to vlan id = 1 (as there's no entry for it on domain_vlan_map) - check ZoneWideNonDedicatedVlanSearch search builder on VlanDaoImpl.
What do you think will be the best solution for this case?

@borisstoyanov

Copy link
Copy Markdown
Contributor

looks like the deployment failed waiting for default template to install, I'll restart
@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

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

@borisstoyanov

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

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

@nvazquez
nvazquezforce-pushed the systemvmpubliciprange branch 2 times, most recently from a85f65c to ca20150CompareOctober 13, 2017 14:56
// This VLAN is domain-wide, so create a DomainVlanMapVO entry
final DomainVlanMapVO domainVlanMapVO = new DomainVlanMapVO(domain.getId(), vlan.getId());
_domainVlanMapDao.persist(domainVlanMapVO);
//final DomainVlanMapVO domainVlanMapVO = new DomainVlanMapVO(domain.getId(), vlan.getId());

@nvazqueznvazquezOct 13, 2017

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Hi Wei @ustcweizhou,
I would like to ask you about persisting entries on doman_vlan_map table. These lines were due to a quick fix for fetching public IP for system vms range, as per search builder on VlanDaoImpl.listZoneWideNonDedicatedVlans does not consider vlans which are mapped on domain_vlan_map only returning range for vlan id = 1. Can you check my last comment on this PR as well?

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.

I think it will break the something obviously.

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-1589)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 35319 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr2295-t1589-kvm-centos7.zip
Intermitten failure detected: /marvin/tests/smoke/test_iso.py
Intermitten failure detected: /marvin/tests/smoke/test_privategw_acl.py
Intermitten failure detected: /marvin/tests/smoke/test_router_dhcphosts.py
Intermitten failure detected: /marvin/tests/smoke/test_ssvm.py
Intermitten failure detected: /marvin/tests/smoke/test_templates.py
Intermitten failure detected: /marvin/tests/smoke/test_vpc_vpn.py
Test completed. 58 look OK, 4 have error(s)

TestResultTime (s)Test File
test_01_vpc_remote_access_vpnFailure60.89test_vpc_vpn.py
test_08_reboot_cpvmFailure0.03test_ssvm.py
test_06_stop_cpvmFailure0.05test_ssvm.py
test_04_cpvm_internalsFailure0.04test_ssvm.py
test_02_list_cpvm_vmFailure0.03test_ssvm.py
test_04_rvpc_privategw_static_routesFailure471.52test_privategw_acl.py
test_04_extract_IsoFailure5.10test_iso.py
test_10_destroy_cpvmError5.15test_ssvm.py
test_change_service_offering_for_vm_with_snapshotsSkipped0.00test_vm_snapshots.py
test_09_copy_delete_templateSkipped0.01test_templates.py
test_06_copy_templateSkipped0.00test_templates.py
test_static_role_account_aclsSkipped0.02test_staticroles.py
test_11_ss_nfs_version_on_ssvmSkipped0.02test_ssvm.py
test_01_scale_vmSkipped0.00test_scale_vm.py
test_01_primary_storage_iscsiSkipped0.08test_primary_storage.py
test_vm_nic_adapter_vmxnet3Skipped0.00test_nic_adapter_type.py
test_nested_virtualization_vmwareSkipped0.00test_nested_virtualization.py
test_06_copy_isoSkipped0.00test_iso.py
test_list_ha_for_host_validSkipped0.01test_hostha_simulator.py
test_list_ha_for_host_invalidSkipped0.01test_hostha_simulator.py
test_list_ha_for_hostSkipped0.02test_hostha_simulator.py
test_hostha_enable_feature_without_setting_providerSkipped0.01test_hostha_simulator.py
test_hostha_enable_feature_validSkipped0.02test_hostha_simulator.py
test_hostha_disable_feature_validSkipped0.02test_hostha_simulator.py
test_hostha_configure_invalid_providerSkipped0.02test_hostha_simulator.py
test_hostha_configure_default_driverSkipped0.01test_hostha_simulator.py
test_ha_verify_fsm_recoveringSkipped0.01test_hostha_simulator.py
test_ha_verify_fsm_fencedSkipped0.02test_hostha_simulator.py
test_ha_verify_fsm_degradedSkipped0.02test_hostha_simulator.py
test_ha_verify_fsm_availableSkipped0.03test_hostha_simulator.py
test_ha_multiple_mgmt_server_ownershipSkipped0.02test_hostha_simulator.py
test_ha_list_providersSkipped0.02test_hostha_simulator.py
test_ha_enable_feature_invalidSkipped0.02test_hostha_simulator.py
test_ha_disable_feature_invalidSkipped0.02test_hostha_simulator.py
test_ha_configure_enabledisable_across_clusterzonesSkipped0.02test_hostha_simulator.py
test_configure_ha_provider_validSkipped0.01test_hostha_simulator.py
test_configure_ha_provider_invalidSkipped0.02test_hostha_simulator.py
test_deploy_vgpu_enabled_vmSkipped0.03test_deploy_vgpu_enabled_vm.py
test_3d_gpu_supportSkipped0.04test_deploy_vgpu_enabled_vm.py

@borisstoyanovborisstoyanov 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.

@nvazquez can you add the account/systemvm exclusiveness check here as well

@nvazquez
nvazquezforce-pushed the systemvmpubliciprange branch from ca20150 to a7855abCompareOctober 18, 2017 12:19
@nvazquez

Copy link
Copy Markdown
ContributorAuthor

@borisstoyanov done.
The only main concern for this community PR is fix for domain_vlan_map. @ustcweizhou could you please give your thoughts/suggestions about that fix (mentioning you as found a commit from you where domain vlan map is introduced and don't want to break your code :) ) ?

* @param vlanId vlan id
* @return true if VLAN IP range is dedicated to system vms
*/
private boolean getIsForSystemVms(long vlanId){

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.

@nvazquez, I would suggest using the name as only isForSystemVms. Thanks!

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Done, thanks

PublicIp ip = _ipAddrMgr.assignPublicIpAddress(dc.getId(), null, vm.getOwner(), VlanType.VirtualNetwork, null, null, false);
boolean forSystemVms = false;
if (vm.getType().equals(VirtualMachine.Type.ConsoleProxy) || vm.getType().equals(VirtualMachine.Type.SecondaryStorageVm)) {
forSystemVms = true;

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.

Don't we need to check the value of SystemVmPublicIpReservationModeStrictness parameter before assigning the value as true for SSVM and CPVM?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Could be another alternative, actually logic is done on IpAddressManagerImpl.fetchNewPublicIp method using forSystemVms and SystemVmPublicIpReservationModeStrictness value.

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.

@nvazquez, I just went with the flow and found out there already exists a column name ("is_system") in user_ip_address table. Can you please see if you can make use of that instead of creating a new one ("forsystemvms").

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

@nitin-maharana sorry for late response, been busy with other tasks. I checked usage of is_system column and are used for static nat or load balancing purposes. Best option should be including this new column.

return None

@attr(tags = ["advanced", "publiciprange", "dedicate", "release"], required_hardware="false")
def test_dedicate_public_ip_range_for_system_vms_cpvm(self):

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.

It would be good if you add a test for SSVM as well.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Done, thanks

Comment threadui/scripts/system.js
var domain = json.listdomainsresponse.domain[0];

if (data.forSystemVms != null) {
systemvms = '<li>' + _l('label.system.vms') + ': ' + data.forSystemVms + '</li>'

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.

I think this should be systemvms = data.forSystemVms, if I am not wrong.

@nvazqueznvazquezOct 26, 2017

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Actually that refactoring will show only true or false in the UI, without knowing what would be it refered to. Please see last screenshot on PR description

Comment threadui/scripts/system.js Outdated
desc: '(optional) Please specify an account to be associated with this IP range.',
fields: fields
title: 'label.set.reservation',
desc: '(optional) Please specify an account to be associated with this IP range.<br/><br/>'+

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.

Can you please replace the sentence with a dictionary key here.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Done, thanks

@nitin-maharana

Copy link
Copy Markdown
Contributor

@nvazquez, Thanks for the feature. Can you please put some snaps of the UI change, Particularly the set reservation form.

@nvazquez

Copy link
Copy Markdown
ContributorAuthor

@nitin-maharana thanks for your review! I'll try addressing your comments asap, thanks!

@nvazquez
nvazquezforce-pushed the systemvmpubliciprange branch from a7855ab to c79c04cCompareOctober 26, 2017 03:24
@nvazquez

nvazquez commented Oct 26, 2017

Copy link
Copy Markdown
ContributorAuthor

@nitin-maharana thanks for your review and comments! UI screenshots are added on PR description and refactor is made based on your comments.

New test case added on marvin test for SSVM, results:

Test public IP range dedication ... === TestName: test_dedicatePublicIpRange | Status : SUCCESS ===
ok
Test public IP range dedication for SSVM and CPVM ... === TestName: test_dedicate_public_ip_range_for_system_vms | Status : SUCCESS ===
ok
Test CPVM Public IP ... === TestName: test_dedicate_public_ip_range_for_system_vms_cpvm | Status : SUCCESS ===
ok
Test SSVM Public IP ... === TestName: test_dedicate_public_ip_range_for_system_vms_ssvm | Status : SUCCESS ===
ok
----------------------------------------------------------------------
Ran 4 tests in 391.510s
OK

@yadvr

yadvr commented Jan 4, 2018

Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-1560

@yadvr

yadvr commented Jan 5, 2018

Copy link
Copy Markdown
Member

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-1583

@yadvr

yadvr commented Jan 5, 2018

Copy link
Copy Markdown
Member

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

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

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

@borisstoyanov

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

@blueorangutan

Copy link
Copy Markdown

Packaging result: ✔centos6 ✔centos7 ✔debian. JID-1599

@borisstoyanov

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

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

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-2018)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 39590 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr2295-t2018-kvm-centos7.zip
Intermitten failure detected: /marvin/tests/smoke/test_accounts.py
Intermitten failure detected: /marvin/tests/smoke/test_affinity_groups_projects.py
Intermitten failure detected: /marvin/tests/smoke/test_affinity_groups.py
Intermitten failure detected: /marvin/tests/smoke/test_privategw_acl.py
Intermitten failure detected: /marvin/tests/smoke/test_vpc_redundant.py
Smoke tests completed. 64 look OK, 3 have error(s)
Only failed tests results shown below:

TestResultTime (s)Test File
ContextSuite context=TestAccounts>:setupError0.00test_accounts.py
ContextSuite context=TestAddVmToSubDomain>:setupError0.00test_accounts.py
test_DeleteDomainError1.59test_accounts.py
test_forceDeleteDomainError1.82test_accounts.py
ContextSuite context=TestRemoveUserFromAccount>:setupError21.96test_accounts.py
ContextSuite context=TestDeployVmWithAffinityGroup>:setupError0.00test_affinity_groups_projects.py
ContextSuite context=TestDeployVmWithAffinityGroup>:setupError0.00test_affinity_groups.py

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-2035)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 30115 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr2295-t2035-kvm-centos7.zip
Intermitten failure detected: /marvin/tests/smoke/test_vpc_vpn.py
Smoke tests completed. 66 look OK, 1 have error(s)
Only failed tests results shown below:

TestResultTime (s)Test File
test_01_redundant_vpc_site2site_vpnFailure228.90test_vpc_vpn.py

@borisstoyanovborisstoyanov 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.

tests LGTM

@yadvr

yadvr commented Jan 6, 2018

Copy link
Copy Markdown
Member

Merging this based on test results and two code review lgtms.

@yadvr
yadvr merged commit 90ef67b into apache:masterJan 6, 2018
yadvr added a commit to shapeblue/cloudstack that referenced this pull request Jan 8, 2018
This fixes regression introduced in PR apache#2295:
- Pass assign=true to fetch new public IP
- Use wait_until instead of sleep+wait in tests
- Loop through list of public IP ranges to match the systemvm gateway
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
yadvr added a commit to shapeblue/cloudstack that referenced this pull request Jan 8, 2018
This fixes regression introduced in PR apache#2295:
- Pass assign=true to fetch new public IP
- Use wait_until instead of sleep+wait in tests
- Loop through list of public IP ranges to match the systemvm gateway
- Fix potential NPE seen when adding simulator host(s)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
yadvr added a commit to shapeblue/cloudstack that referenced this pull request Jan 9, 2018
This fixes regression introduced in PR apache#2295:
- Pass assign=true to fetch new public IP
- Use wait_until instead of sleep+wait in tests
- Loop through list of public IP ranges to match the systemvm gateway
- Fix potential NPE seen when adding simulator host(s)
- Removes aria2 installation from setup_agent.sh using yum, it's already
dependency for cloudstack-agent package
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
yadvr added a commit that referenced this pull request Jan 9, 2018
This fixes regression introduced in PR #2295:
- Pass assign=true to fetch new public IP
- Use wait_until instead of sleep+wait in tests
- Loop through list of public IP ranges to match the systemvm gateway
- Fix potential NPE seen when adding simulator host(s)
- Removes aria2 installation from setup_agent.sh using yum, it's already
dependency for cloudstack-agent package
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
@nvazquez
nvazquez deleted the systemvmpubliciprange branch April 6, 2020 14:52
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.

6 participants

@nvazquez@blueorangutan@borisstoyanov@nitin-maharana@yadvr@ustcweizhou