You are browsing a read-only backup copy of Wikitech. The live site can be found at wikitech.wikimedia.org
DNS/Netbox: Difference between revisions
imported>Volans m (→DNS records involved: migrated esams mgmt records) |
imported>Volans m (→Cutoff dates: Add offline script mention) |
||
Line 1: | Line 1: | ||
Part of the DNS records are or will soon be automatically generated from data that resides in [[Netbox]]. | Part of the DNS records and IP allocations are or will soon be automatically generated from data that resides in [[Netbox]]. | ||
== Infrastructure == | == Infrastructure == | ||
* IP allocation is done on Netbox. | |||
* Netbox data is exported via [[Netbox#DNS]]. | * Netbox data is exported via [[Netbox#DNS]]. | ||
* Netbox data is checked out on the authoritative DNS servers in <code>/srv/git/netbox_dns_snippets</code>. | * Netbox data is checked out on the authoritative DNS servers in <code>/srv/git/netbox_dns_snippets</code>. | ||
* When compiling the <code>gdnsd</code> final zones, the Netbox data is copied into <code>/etc/gdnsd/zones/netbox</code> for later inclusion. | * When compiling the <code>gdnsd</code> final zones, the Netbox data is copied into <code>/etc/gdnsd/zones/netbox</code> for later inclusion. | ||
* In the actual zonefiles, within an <code>$ORIGIN</code>, the related snippet file is included using the <code>$INCLUDE</code> directive. | * In the actual zonefiles, within an <code>$ORIGIN</code>, the related snippet file is included using the <code>$INCLUDE</code> directive. | ||
== IP Allocation == | |||
The migration to the automated system requires that we move the allocation of IPs to Netbox that will gradually become the authoritative source of truth for IPAM. | |||
=== Cutoff dates === | |||
* '''[Wednesday June 24th 2020 10am UTC]''' '''All''' the management IP address allocation will be performed in Netbox from now on. Either via the [https://netbox.wikimedia.org/extras/scripts/interface_automation/AssignIPs/ Add interfaces and IPs to devices] Netbox script for provisioning new devices or manually via the ''Add an IP Address'' button in the ''IP Addresses'' tab of any IP Prefix that will assign the first available IP in that subnet. The [https://netbox.wikimedia.org/extras/scripts/offline_device/OfflineDevice/ Offline a device with extra actions] Netbox script takes instead care of the removal of interfaces and IPs when setting a device offline. | |||
* '''[TBD]''' '''All''' the primary IPv4 and IPv6 address allocation will be performed in Netbox from now on. | |||
== DNS records involved == | == DNS records involved == |
Revision as of 20:57, 22 June 2020
Part of the DNS records and IP allocations are or will soon be automatically generated from data that resides in Netbox.
Infrastructure
- IP allocation is done on Netbox.
- Netbox data is exported via Netbox#DNS.
- Netbox data is checked out on the authoritative DNS servers in
/srv/git/netbox_dns_snippets
. - When compiling the
gdnsd
final zones, the Netbox data is copied into/etc/gdnsd/zones/netbox
for later inclusion. - In the actual zonefiles, within an
$ORIGIN
, the related snippet file is included using the$INCLUDE
directive.
IP Allocation
The migration to the automated system requires that we move the allocation of IPs to Netbox that will gradually become the authoritative source of truth for IPAM.
Cutoff dates
- [Wednesday June 24th 2020 10am UTC] All the management IP address allocation will be performed in Netbox from now on. Either via the Add interfaces and IPs to devices Netbox script for provisioning new devices or manually via the Add an IP Address button in the IP Addresses tab of any IP Prefix that will assign the first available IP in that subnet. The Offline a device with extra actions Netbox script takes instead care of the removal of interfaces and IPs when setting a device offline.
- [TBD] All the primary IPv4 and IPv6 address allocation will be performed in Netbox from now on.
DNS records involved
- Management forward (
A
) and reverse (PTR
) records for both the hostname (foo.mgmt.eqiad.wmnet
) and the asset tag (wmf1234.mgmt.eqiad.wmnet
) - Primary IPv4 (
A
) and IPv6 (AAAA
) and related reverse (PTR
) records for the hostname (foo.eqiad.wmnet
orfoo.wikimedia.org
)
Active
Management
ulsfo
eqsin
esams
Primary IPs
- NONE
To be migrated
Management
frack
incodfw
frack
ineqiad
codfw
eqiad
Primary IPs
ulsfo
eqsin
esams
frack
incodfw
frack
ineqiad
codfw
eqiad
Operations
Update generated records
To update the dynamically generated records based on the current Netbox data and deploy them to all the authoritative DNS servers, the sre.dns.netbox
cookbook must be run. See also Cookbooks#Cookbook_Operations. For example:
sudo cookbook sre.dns.netbox -t T12345 "Add newly racked cp hosts in eqiad"
Convert an hardcoded $ORIGIN to Netbox
This is an example patch to convert an hardcoded $ORIGIN
to the dynamically generated data.
Transition
The records involved in the transition from hardcoded records to the Netbox driven ones and the order of the transition is listed above, see the To be migrated section.
Here's an example patch of the transition of management records for ulsfo
.
What changes
The changes in procedure are outlined in the Server_Lifecycle/DNS_Transition page.