Skip to content

Fix no "data-server" DNS record for VPC router#4873

Merged
yadvr merged 1 commit into
apache:4.14from
aleskxyz:vpc-data-server
Apr 5, 2021
Merged

Fix no "data-server" DNS record for VPC router#4873
yadvr merged 1 commit into
apache:4.14from
aleskxyz:vpc-data-server

Conversation

@aleskxyz

Copy link
Copy Markdown
Contributor

Description

This PR adds the capability to VPC VR to answer "data-server" DNS queries based on the source IP of the VM.

  1. Creates a new record for "data-server" translated to VR IP of newly create subnet in /etc/hosts file
  2. Configure dnsmasq to send response of "data-server" query based on source IP of VM
STEPS TO REPRODUCE
1. Create a VPC
2. Add an isolated network with UserData service with VirtualRouter as provider
3. Create a VM in this network
4. Run "nslookup data-server" command from inside of VM
5. Run "cat /etc/hosts" command from inside of VR
EXPECTED RESULTS
Running "nslookup data-server" command returns IP address of router
Running "cat /etc/hosts" command from inside of VR shows "data-server" record and the VR NIC IP
ACTUAL RESULTS
Running "nslookup data-server" command returns "No answer"
The result of running "cat /etc/hosts" command from inside of VR, don't have any record about "data-server"

Fixes: #4865

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

image

How Has This Been Tested?

Apply the patch directly to VPC VR.
Add new subnet to VR, then add a new VM and check the record existance.
Restart VPC and check recreation of records.
Remove all VMs from the subnet and check the record is deleted.

listen_address.append(ip)
# Add localized "data-server" records in /etc/hosts for VPC routers
if self.config.is_vpc():
self.add_host(gateway, "%s data-server" % CsHelper.get_hostname())

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.

this can only work if we know for sure that CsHelper.get_hostname() gives an ip address and no hostname, are we?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this can only work if we know for sure that CsHelper.get_hostname() gives an ip address and no hostname, are we?

@DaanHoogland
CsHelper.get_hostname() gives the hostname of virtual router. As you can see in screenshot, 'r-24-VM' is the hostname. So it should return hostname, not IP.

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.

sorry, never mind, I mis-interpreted the semantics of add_host(). no ip needed in that parameter, a (list of) hosts-name(s) is fine.

@yadvr yadvr requested a review from weizhouapache April 1, 2021 06:47
@yadvr yadvr added this to the 4.15.1.0 milestone Apr 1, 2021
@yadvr yadvr requested review from andrijapanicsb and nvazquez April 1, 2021 06:47
@yadvr

yadvr commented Apr 1, 2021

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: ✔️ centos7 ✔️ debian. SL-JID 303

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

tested ok

@yadvr

yadvr commented Apr 4, 2021

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

@blueorangutan

Copy link
Copy Markdown

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

Test Result Time (s) Test File
test_01_migrate_VM_and_root_volume Error 82.59 test_vm_life_cycle.py
test_02_migrate_VM_with_two_data_disks Error 51.18 test_vm_life_cycle.py

@yadvr yadvr merged commit ca4669c into apache:4.14 Apr 5, 2021
@aleskxyz aleskxyz deleted the vpc-data-server branch April 5, 2021 12:55
nlgordon pushed a commit to ippathways/cloudstack that referenced this pull request Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants