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

Detect Azure when DHCP domain is set to reddog.microsoft.com #1521

Conversation

jasonwbarnett
Copy link
Contributor

@jasonwbarnett jasonwbarnett commented Sep 30, 2020

Description

This will detect that a node is on Azure if DHCP option 15 is set to reddog.microsoft.com which Microsoft does in Azure for all customers.

When you are using Azure-provided name resolution, Azure Dynamic Host Configuration Protocol (DHCP) provides an internal DNS suffix (.internal.cloudapp.net) to each VM. This suffix enables host name resolution because the host name records are in the internal.cloudapp.net zone. When you are using your own name resolution solution, this suffix is not supplied to VMs because it interferes with other DNS architectures (like domain-joined scenarios). Instead, Azure provides a non-functioning placeholder (reddog.microsoft.com).

Reference: https://docs.microsoft.com/en-us/azure/virtual-network/virtual-networks-name-resolution-for-vms-and-role-instances

Related Issue

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Chore (non-breaking change that does not add functionality or fix an issue)

Checklist:

  • I have read the CONTRIBUTING document.
  • I have run the pre-merge tests locally and they pass.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • All commits have been signed-off for the Developer Certificate of Origin.

@jasonwbarnett jasonwbarnett requested review from a team as code owners September 30, 2020 13:20
@jasonwbarnett jasonwbarnett force-pushed the feature/add-additional-detection-logic-for-azure branch 2 times, most recently from a8d7b83 to 47314bf Compare September 30, 2020 13:23
@jasonwbarnett
Copy link
Contributor Author

I haven't written any unit tests, yet. I have tested this on an Azure host and a non-azure host and the code is working as expected.

I plan to write unit tests as soon as I get affirmation this implementation/strategy makes sense.

@jasonwbarnett
Copy link
Contributor Author

@tas50 @phiggins Let me know if this is ready to rock and I'll get started on building out test coverage.

@tas50
Copy link
Contributor

tas50 commented Sep 30, 2020

This seems like a pretty solid approach to me. Go for it.

@jasonwbarnett jasonwbarnett force-pushed the feature/add-additional-detection-logic-for-azure branch 3 times, most recently from ed5ff3a to 384ba0b Compare September 30, 2020 18:38
Signed-off-by: Jason Barnett <jason.w.barnett@gmail.com>
@jasonwbarnett jasonwbarnett force-pushed the feature/add-additional-detection-logic-for-azure branch from 384ba0b to a60af6b Compare September 30, 2020 18:49
@jasonwbarnett
Copy link
Contributor Author

@tas50 this is ready for review. Let me know if there are any docs that need to be updated as a result of this change.

@tas50 tas50 added the Expeditor: Bump Version Minor Used by github.minor_bump_labels to bump the Minor version number. label Sep 30, 2020
@tas50 tas50 merged commit 234c5c9 into chef:master Sep 30, 2020
@tas50
Copy link
Contributor

tas50 commented Sep 30, 2020

Thanks @jasonwbarnett

@jasonwbarnett jasonwbarnett deleted the feature/add-additional-detection-logic-for-azure branch October 1, 2020 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Expeditor: Bump Version Minor Used by github.minor_bump_labels to bump the Minor version number.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows nodes on Azure that do not have the WAAgent are not collecting Azure attributes
2 participants