Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent deploying IPv6 network if Zone has no IPv6 DNS configured #4177

Merged
merged 6 commits into from
Oct 30, 2020

Conversation

GabrielBrascher
Copy link
Member

@GabrielBrascher GabrielBrascher commented Jun 24, 2020

Description

If an IPv6 enabled network is created but the Zone hasn't IPv6 DNS1 or DNS2 configured then dnsmasq inside the Virtual Router does not start.

This PRs adds validation that allows creating an IPv6 network only if the Zone has at least DNS1 or DNS2 configured.

Fixes: #4157

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)

@GabrielBrascher GabrielBrascher added this to the 4.15.0.0 milestone Jun 24, 2020
@GabrielBrascher GabrielBrascher self-assigned this Jun 24, 2020
If you have a IPv6 enabled network and you haven't specified the IPv6 DNS 1 and DNS 2 under the zone it causes dnsmasq inside the Virtual Router not to start
Fix logic on checkIp6Parameters
@GabrielBrascher GabrielBrascher changed the title Prevent deploying IPv6 network if Zone has no IPv6 DNS configured [WIP] Prevent deploying IPv6 network if Zone has no IPv6 DNS configured Jun 26, 2020
@@ -3781,7 +3781,7 @@ public Vlan createVlanAndPublicIpRange(final long zoneId, final long networkId,
ipv4 = true;
}

if (startIPv6 != null) {
if (vlanIp6Cidr != null) {
Copy link
Member Author

@GabrielBrascher GabrielBrascher Jun 26, 2020

Choose a reason for hiding this comment

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

CloudStack uses SLAAC for managing IPv6 ranges, therefore it is not necessary to have a start/end IPv6 address; on the other hand, IPv6 CIDR is mandatory for IPv6 networks.

That is why I changed this and other pieces of code that had start/end ipv6 address as mandatory.

@@ -1195,7 +1195,7 @@ public Network createGuestNetwork(CreateNetworkCmd cmd) throws InsufficientCapac
if (startIP != null) {
ipv4 = true;
}
if (startIPv6 != null) {
if (isNotBlank(ip6Cidr) && isNotBlank(ip6Gateway)) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Due to SLAAC implementation, an IPv6 network needs CIDR and Gateway. With the refactored code a network is "marked" as ipv6 if IPv6 CIDR and Gateway are not null.

@@ -90,6 +91,11 @@
private static final long PHYSICAL_NETWORK_1_ID = 1L;
private static final long PHYSICAL_NETWORK_2_ID = 2L;

private static final String IPV6_CIDR = "fd59:16ba:559b:243d::/64";
Copy link
Member Author

Choose a reason for hiding this comment

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

Nowadays IPv6 networking support only /64 CIDR. Added Unit tests covering this.

@GabrielBrascher GabrielBrascher changed the title [WIP] Prevent deploying IPv6 network if Zone has no IPv6 DNS configured Prevent deploying IPv6 network if Zone has no IPv6 DNS configured Jun 26, 2020
@GabrielBrascher
Copy link
Member Author

Fixed conflict with the master.

@GabrielBrascher
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

Packaging result: ✔centos7 ✔centos8 ✔debian. JID-2081

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

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

code looks good and makes functional sense. are integration tests for this sensible/possible? (not playing down on the importance of the unit tests you created)

@GabrielBrascher
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

Packaging result: ✔centos7 ✔centos8 ✔debian. JID-2094

@DaanHoogland
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

Packaging result: ✖centos7 ✖centos8 ✔debian. JID-2221

@DaanHoogland
Copy link
Contributor

@blueorangutan package

Copy link
Contributor

@Pearl1594 Pearl1594 left a comment

Choose a reason for hiding this comment

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

LGTM

@GabrielBrascher
Copy link
Member Author

@DaanHoogland @rhtyd @Pearl1594 @sureshanaparti looking at the codebase for IPv6 there are still a lot of things to improve.

I will leave some of these parts for future PRs as they require testing and so far I made manual tests specifically for the reported issue #4157. This PR is partially improving the IPv6, mostly avoiding some critical deployment failures due to a lack of ipv6 gateway/DNS.

Unfortunately, most of our execution flow regarding IPv6 needs to be refactored, this current PR adds a small contribution on behalf of issue #3569, but mainly focused on fixing #4157.

I can re-run a couple of manual tests just for the sake. For the (near) future, I think that we should have some IPv6 Marvin tests. I can look into contributing with it.

@DaanHoogland
Copy link
Contributor

@GabrielBrascher the issue this PR solves is marked for 4.13.2. do you want to have this merged on master anyway?

@GabrielBrascher GabrielBrascher changed the base branch from master to 4.13 October 28, 2020 18:43
@GabrielBrascher
Copy link
Member Author

@DaanHoogland sounds good. Rebased/cherry-picked respective commits aiming branch 4.13.

@GabrielBrascher
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

Packaging result: ✖centos7 ✖centos8 ✖debian. JID-2303

@DaanHoogland
Copy link
Contributor

not sure if the ape still knows 4.13 but i think it should
@blueorangutan package

@GabrielBrascher
Copy link
Member Author

I am not sure as well. Travis seems to not work. Maybe due to the migration of java 8 to java 11

@GabrielBrascher
Copy link
Member Author

@DaanHoogland do you think that it would be better to aim this to 4.15 so we can run tests?

@DaanHoogland
Copy link
Contributor

@GabrielBrascher you can go for 4.14 as well (or just master)

@GabrielBrascher GabrielBrascher changed the base branch from 4.13 to master October 29, 2020 16:46
@GabrielBrascher
Copy link
Member Author

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

Packaging result: ✔centos7 ✔centos8 ✔debian. JID-2311

@DaanHoogland
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

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

@blueorangutan
Copy link

Trillian test result (tid-3107)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 34725 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr4177-t3107-kvm-centos7.zip
Intermittent failure detected: /marvin/tests/smoke/test_kubernetes_clusters.py
Intermittent failure detected: /marvin/tests/smoke/test_vm_snapshots.py
Smoke tests completed. 85 look OK, 1 have error(s)
Only failed tests results shown below:

Test Result Time (s) Test File
test_03_deploy_and_upgrade_kubernetes_cluster Failure 249.52 test_kubernetes_clusters.py

@DaanHoogland DaanHoogland merged commit 6f559d2 into apache:master Oct 30, 2020
Pearl1594 pushed a commit to shapeblue/cloudstack that referenced this pull request Nov 4, 2020
Pearl1594 pushed a commit to shapeblue/cloudstack that referenced this pull request Nov 4, 2020
Sign up for free to 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.

dnsmasq in Virtual Router fails to start in IPv6 enabled network
8 participants