Skip to content

Conversation

@Pearl1594
Copy link
Contributor

Description

This PR is a GSoC project: #4814

This PR adds a feature to L2 persitent networks, where resources of the persistent networks are created at hostConnect phase of DefaultHostListener, and cleaned up at hostAboutToBeRemoved phase.

This PR also fixes a bug, where rebooting the hosts removes the persistent network's resources, without readding them when the host is readded to the zone.

Continuation of PR: #5195
Fixes: #5196

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

How Has This Been Tested?

This has been manually tested with a mbx KVM, XenServer and VmWare setup on a local machine.

Different manual test scenarios:

  1. When the persistent network is created and the host is added afterwards, the newly added host has the persistent network's resources.
  2. When a host within a zone with a persistent network is removed from the zone, its resources will be cleaned up.
  3. When a host with a running VM is removed from the zone, the running VM will migrate before the resources are cleaned up.
  4. When a host is rebooted, it still has access to the persistent network's resources.

A Marvin component test under
test/integration/component/test_persistent_networks.py
added that tests the following steps for a KVM environment.

  1. identify hosts in the zone, and remove the first
  2. create a L2 persistent network
  3. add the host back to the zone

Validation steps:

  1. Persistent network state should be implemented before adding the host
  2. Host should be added back in successfully
  3. Host should have the persistent networks resources after being added

Test output results should be:

==== Marvin Init Started ====

=== Marvin Parse Config Successful ===

=== Marvin Setting TestData Successful===

==== Log Folder Path: /tmp/MarvinLogs/. All logs will be available here ====

=== Marvin Init Logging Successful===

==== Marvin Init Successful ====
====Trying SSH Connection: Host:172.20.0.121 User:root Port:22 RetryCnt:10===
===SSH to Host 172.20.0.121 port : 22 SUCCESSFUL===
{Cmd: ip addr | grep breth0-991 > /dev/null 2>&1; echo $? via Host: 172.20.0.121} {returns: ['0']}
=== TestName: test_newly_added_host_for_persistent_network_resources | Status : SUCCESS ===

===final results are now copied to: /tmp//MarvinLogs/test_persistent_networks_===

@Pearl1594
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

Packaging result: ✖️ el7 ✖️ el8 ✖️ debian ✖️ suse15. SL-JID 2559

@Pearl1594 Pearl1594 force-pushed the pers_net_feature-gsoc2021 branch from 61ffcdf to 56bb154 Compare February 10, 2022 07:24
@Pearl1594
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 2561

@Pearl1594
Copy link
Contributor Author

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

Trillian test result (tid-3288)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 32532 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5977-t3288-kvm-centos7.zip
Smoke tests completed. 92 look OK, 0 have errors
Only failed tests results shown below:

Test Result Time (s) Test File


@Override
public List<NetworkVO> getAllPersistentNetworksFromZone(long dataCenterId) {
Object[] guestTypes = {"Isolated", "L2"};
Copy link
Member

Choose a reason for hiding this comment

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

@Pearl1594
cannot Isolated network be persistent ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

they can @weizhouapache hence Isolated & l2 are included in the search criteria

Copy link
Member

Choose a reason for hiding this comment

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

@Pearl1594
oh thanks... stupid me. I thought it contains Shared and L2 ...

why exclude Shared networks ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We dont have a concept of Persistent shared networks currently @weizhouapache

Copy link
Member

Choose a reason for hiding this comment

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

@Pearl1594
Copy link
Contributor Author

@blueorangutan package

@Pearl1594 Pearl1594 marked this pull request as ready for review February 21, 2022 09:25
@blueorangutan
Copy link

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


@Override
public List<NetworkVO> getAllPersistentNetworksFromZone(long dataCenterId) {
Object[] guestTypes = {"Isolated", "L2"};
Copy link
Member

Choose a reason for hiding this comment

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

@Pearl1594
oh thanks... stupid me. I thought it contains Shared and L2 ...

why exclude Shared networks ?

to.setIsolationuri(networkVO.getBroadcastUri());
to.setNetworkRateMbps(configManager.getNetworkOfferingNetworkRate(networkOfferingVO.getId(), networkVO.getDataCenterId()));
to.setSecurityGroupEnabled(networkModel.isSecurityGroupSupportedInNetwork(networkVO));
return to;
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think it is required @weizhouapache

Copy link
Member

Choose a reason for hiding this comment

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

@Pearl1594 ok to me.

return true;
}

private void setupPersistentNetwork(HostVO host) {
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if it is neccesary to create bridges, vlans on kvm hosts, although it is not harmful.
from my understanding, persist L2/Isolated network means the vlan id will be not released even if there is no vm running.
for vmware/xenserver, it might be useful.

Copy link
Member

Choose a reason for hiding this comment

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

@Pearl1594
can you explain a bit what's the benifit of this feature ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So, we had persistent networks in ACS - and by definition, these networks are meant to be setup at the time of network created across all hosts. However, while the definition in the docs said that, it didn't actually behave that way. So when a new host is added no bridge/vlan/port-group of the existing persistent network is present. So the idea of this enhancement, is to setup network on the new hosts or when disable hosts are enabled to stay true to the definition of Persistent networks as per docs.

Copy link
Member

Choose a reason for hiding this comment

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

@Pearl1594
I just read the cloudstack document http://docs.cloudstack.apache.org/en/latest/adminguide/networking/persistent_networks.html
which was updated by apache/cloudstack-documentation#183

The only thing different from what I understand is

-  Creation of an L2 Persistent network setups up the network devices namely,
   bridges, VLANs or port-groups across all hosts in a zone.

I do not see the benifit to have permanent linux bridges but without any vm on kvm hosts.
I have no idea it is useful for vmware or xenserver.

in my understanding, persistent network means the network will not be shutdown even if no vm running. therefore vlan will be released/re-allocated, virtual router will not be stopped, which are useful for network administrators and users.

@blueorangutan
Copy link

Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 2669

@Pearl1594 Pearl1594 self-assigned this Feb 21, 2022
@Pearl1594 Pearl1594 force-pushed the pers_net_feature-gsoc2021 branch from e59c5fb to d80623b Compare February 23, 2022 12:50
@Pearl1594
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

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

@Pearl1594
Copy link
Contributor Author

@blueorangutan package

1 similar comment
@DaanHoogland
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@DaanHoogland a 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: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 2947

@nvazquez
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

Trillian test result (tid-3689)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 32526 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5977-t3689-kvm-centos7.zip
Smoke tests completed. 92 look OK, 0 have errors
Only failed tests results shown below:

Test Result Time (s) Test File

@nvazquez
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@nvazquez a 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.

Copy link
Contributor

@NuxRo NuxRo left a comment

Choose a reason for hiding this comment

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

LGTM

@blueorangutan
Copy link

Packaging result: ✔️ el7 ✖️ el8 ✔️ debian ✔️ suse15. SL-JID 3120

@nvazquez
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@nvazquez a 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: ✖️ el7 ✔️ el8 ✖️ debian ✖️ suse15. SL-JID 3123

@nvazquez
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@nvazquez a 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: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 3126

@nvazquez
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

Trillian test result (tid-3854)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 32585 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr5977-t3854-kvm-centos7.zip
Smoke tests completed. 93 look OK, 0 have errors
Only failed tests results shown below:

Test Result Time (s) Test File

@nvazquez nvazquez merged commit 431c352 into apache:main Apr 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

Rebooting a host in a zone, doesn't re-add the persistent network's resources

6 participants