Skip to content

api,server: custom dns for guest network#6425

Merged
shwstppr merged 31 commits into
apache:mainfrom
shapeblue:add-network-custom-dns
Sep 10, 2022
Merged

api,server: custom dns for guest network#6425
shwstppr merged 31 commits into
apache:mainfrom
shapeblue:add-network-custom-dns

Conversation

@shwstppr

@shwstppr shwstppr commented May 31, 2022

Copy link
Copy Markdown
Contributor

Description

Adds option to provide custom DNS servers for isolated network, shared network and VPC tier.
New API parameters added in createNetwork API along with the corresponding response parameters.

Doc PR: apache/cloudstack-documentation#276

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

Screenshots (if appropriate):

add-guest-network

add-shared-network

Screenshot from 2022-06-20 17-38-46

How Has This Been Tested?

Manually ran new marvin test:

[root@pr6425-t4310-vmware-67u3-marvin marvin]# nosetests --with-xunit --xunit-file=results.xml --with-marvin --marvin-config=./pr6425-t4310-vmware-67u3-advanced-cfg -s -a tags=advanced --hypervisor=VMware tests/component/test_network_vpc_custom_dns.py 
/usr/local/lib/python3.6/site-packages/paramiko/transport.py:33: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore, support for it is deprecated in cryptography and will be removed in a future release.
  from cryptography.hazmat.backends import default_backend

==== Marvin Init Started ====

=== Marvin Parse Config Successful ===

=== Marvin Setting TestData Successful===

==== Log Folder Path: /marvin/MarvinLogs/Jun_16_2022_07_07_09_BQCG9M All logs will be available here ====

=== Marvin Init Logging Successful===

==== Marvin Init Successful ====
====Trying SSH Connection: Host:10.0.34.87 User:root                                   Port:22 RetryCnt:60===
===SSH to Host 10.0.34.87 port : 22 SUCCESSFUL===
{Cmd: ssh -i /var/cloudstack/management/.ssh/id_rsa -ostricthostkeychecking=no -oUserKnownHostsFile=/dev/null -p 3922 10.0.36.189 cat /etc/resolv.conf via Host: 10.0.34.87} {returns: ['nameserver 5.5.5.5', 'nameserver 6.6.6.6', 'nameserver 2001:4860:4860::5555', 'nameserver 2001:4860:4860::6666']}
=== TestName: test_01_verify_network_dns | Status : SUCCESS ===

====Trying SSH Connection: Host:10.0.34.87 User:root                                   Port:22 RetryCnt:60===
====Trying SSH Connection: Host:10.0.34.87 User:root                                   Port:22 RetryCnt:60===
===SSH to Host 10.0.34.87 port : 22 SUCCESSFUL===
===SSH to Host 10.0.34.87 port : 22 SUCCESSFUL===
{Cmd: ssh -i /var/cloudstack/management/.ssh/id_rsa -ostricthostkeychecking=no -oUserKnownHostsFile=/dev/null -p 3922 10.0.36.190 cat /etc/resolv.conf via Host: 10.0.34.87} {returns: ['nameserver 5.5.5.5', 'nameserver 6.6.6.6', 'nameserver 2001:4860:4860::5555', 'nameserver 2001:4860:4860::6666']}
{Cmd: ssh -i /var/cloudstack/management/.ssh/id_rsa -ostricthostkeychecking=no -oUserKnownHostsFile=/dev/null -p 3922 10.0.36.190 cat /etc/resolv.conf via Host: 10.0.34.87} {returns: ['nameserver 5.5.5.5', 'nameserver 6.6.6.6', 'nameserver 2001:4860:4860::5555', 'nameserver 2001:4860:4860::6666']}
=== TestName: test_01_verify_vpc_dns | Status : SUCCESS ===

=== Final results are now copied to: /marvin//MarvinLogs/test_network_vpc_custom_dns_2CPKHK ===

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@shwstppr
shwstppr force-pushed the add-network-custom-dns branch from af4e23f to ec4efbe Compare June 1, 2022 08:01
@apache apache deleted a comment from acs-robot Jun 1, 2022
@apache apache deleted a comment from blueorangutan Jun 1, 2022
@apache apache deleted a comment from acs-robot Jun 1, 2022
@apache apache deleted a comment from blueorangutan Jun 1, 2022
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Comment on lines +2646 to +2660
public Pair<String, String> getNetworkIp4Dns(final Network network, final DataCenter zone) {
String dns1 = null;
String dns2 = null;
if (org.apache.commons.lang3.StringUtils.isNotEmpty(network.getDns1())) {
dns1 = network.getDns1();
if (org.apache.commons.lang3.StringUtils.isNotEmpty(network.getDns2())) {
dns2 = network.getDns2();
}
}
if (org.apache.commons.lang3.StringUtils.isEmpty(dns1)) {
dns1 = zone.getDns1();
}
if (org.apache.commons.lang3.StringUtils.isEmpty(dns2)) {
dns2 = zone.getDns2();
}

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 we throw an exception if either is dns1 or dns2 still null?

@DaanHoogland

Copy link
Copy Markdown
Contributor

is this open for a review yet @shwstppr ?

@shwstppr

shwstppr commented Jun 3, 2022

Copy link
Copy Markdown
Contributor Author

is this open for a review yet @shwstppr ?

@DaanHoogland no, not yet

shwstppr added 2 commits June 3, 2022 15:15
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@acs-robot

Copy link
Copy Markdown

Found UI changes, kicking a new UI QA build
@blueorangutan ui

@shwstppr

shwstppr commented Jun 6, 2022

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@shwstppr 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
Copy Markdown

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

shwstppr added 2 commits June 7, 2022 15:36
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@blueorangutan

Copy link
Copy Markdown

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

Test Result Time (s) Test File

@blueorangutan

Copy link
Copy Markdown

Trillian test result (tid-4668)
Environment: vmware-65u2 (x2), Advanced Networking with Mgmt server 7
Total time taken: 42174 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6425-t4668-vmware-65u2.zip
Smoke tests completed. 100 look OK, 1 have errors
Only failed tests results shown below:

Test Result Time (s) Test File
test_08_upgrade_kubernetes_ha_cluster Failure 649.66 test_kubernetes_clusters.py

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

LGTM, good feature!

@alexandremattioli

Copy link
Copy Markdown
Contributor

LGTM

@codecov

codecov Bot commented Aug 25, 2022

Copy link
Copy Markdown

Codecov Report

Merging #6425 (c07191e) into main (f76b6c6) will decrease coverage by 0.00%.
The diff coverage is 1.00%.

@@             Coverage Diff              @@
##               main    #6425      +/-   ##
============================================
- Coverage      5.87%    5.87%   -0.01%     
- Complexity     3934     3935       +1     
============================================
  Files          2454     2454              
  Lines        242682   242909     +227     
  Branches      37980    38023      +43     
============================================
+ Hits          14261    14263       +2     
- Misses       226842   227062     +220     
- Partials       1579     1584       +5     
Impacted Files Coverage Δ
...estration/service/NetworkOrchestrationService.java 100.00% <ø> (ø)
...tack/engine/orchestration/NetworkOrchestrator.java 0.00% <0.00%> (ø)
...src/main/java/com/cloud/network/dao/NetworkVO.java 21.71% <0.00%> (-1.66%) ⬇️
...ema/src/main/java/com/cloud/network/vpc/VpcVO.java 0.00% <0.00%> (ø)
.../network/vpc/dao/VpcOfferingServiceMapDaoImpl.java 0.00% <0.00%> (ø)
.../baremetal/networkservice/BaremetaNetworkGuru.java 0.00% <0.00%> (ø)
...bernetes/cluster/KubernetesClusterManagerImpl.java 0.00% <0.00%> (ø)
...src/main/java/com/cloud/api/ApiResponseHelper.java 0.00% <0.00%> (ø)
.../java/com/cloud/hypervisor/HypervisorGuruBase.java 3.57% <0.00%> (-0.06%) ⬇️
...n/java/com/cloud/network/IpAddressManagerImpl.java 0.00% <0.00%> (ø)
... and 20 more

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

@acs-robot

Copy link
Copy Markdown

Found UI changes, kicking a new UI QA build
@blueorangutan ui

@blueorangutan

Copy link
Copy Markdown

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

UI build: ✔️
Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/6425 (SL-JID-2219)

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
@acs-robot

Copy link
Copy Markdown

Found UI changes, kicking a new UI QA build
@blueorangutan ui

@blueorangutan

Copy link
Copy Markdown

@acs-robot a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@shwstppr

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

UI build: ✔️
Live QA URL: http://qa.cloudstack.cloud:8080/client/pr/6425 (SL-JID-2252)

@sonarqubecloud

Copy link
Copy Markdown

SonarCloud Quality Gate failed.    Quality Gate failed

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

0.0% 0.0% Coverage
2.1% 2.1% Duplication

@shwstppr

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@shwstppr 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
Copy Markdown

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

@shwstppr

Copy link
Copy Markdown
Contributor Author

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@shwstppr 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-4778)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 37855 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6425-t4778-kvm-centos7.zip
Smoke tests completed. 101 look OK, 0 have errors
Only failed tests results shown below:

Test Result Time (s) Test File

@shwstppr

shwstppr commented Sep 9, 2022

Copy link
Copy Markdown
Contributor Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@shwstppr 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
Copy Markdown

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

@blueorangutan

Copy link
Copy Markdown

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

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

LGTM

@shwstppr

shwstppr commented Sep 9, 2022

Copy link
Copy Markdown
Contributor Author

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@shwstppr 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-4856)
Environment: kvm-centos7 (x2), Advanced Networking with Mgmt server 7
Total time taken: 45063 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr6425-t4856-kvm-centos7.zip
Smoke tests completed. 100 look OK, 1 have errors
Only failed tests results shown below:

Test Result Time (s) Test File
test_08_upgrade_kubernetes_ha_cluster Failure 657.86 test_kubernetes_clusters.py

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.

7 participants