Adding default search domain - DNS


#1

Hi,

I few days ago i started having issues deploying my Openstack bundle. The issue seems to be focused around DNS.
Specifically my ha clustered nova-cloud-controller is unable to resolve my host “h14” by that name. Checking myself it does not work until i add the search domain in netplan or by using FQDN.

  nameservers:
    addresses: [10.10.10.2]
    search: [example.net]

I realize that i may have caused this because i added a second authoritative domain in maas, after that i started having problems.

I was wondering if anyone knows where juju has it netplan templates so that i can modify it to include the searchdomain?
Or if there is another better way to add the search domain.
Maybe i have stumbled on a bug?

Thanks in advance!
Emil


#2

Update:
I have retrieved some logs from one of the machines and one of the lxd containers.

Physical machine: (machine-2.log)

2019-02-07 15:21:48 WARNING juju.provisioner broker.go:104 no search domains supplied by provider, using host’s search domains.
2019-02-07 15:21:48 WARNING juju.provisioner broker.go:112 incomplete DNS config found, discovering host’s DNS config

Nova-Cloud-Controller: (unit-nova-cloud-controller-0.log)

2019-02-06 18:23:54 DEBUG juju-log identity-service:29: 0 section(s) found
2019-02-06 18:23:54 INFO juju-log identity-service:29: HAProxy context is incomplete, this unit has no peers.
2019-02-06 18:23:55 INFO juju-log identity-service:29: HAProxy context is incomplete, this unit has no peers.
2019-02-06 18:23:55 INFO juju-log identity-service:29: Generating template context from neutron api relation
2019-02-06 18:23:55 INFO juju-log identity-service:29: identity-service relation incomplete. Peer not ready?
2019-02-06 18:23:55 INFO juju-log identity-service:29: Registered config file:
2019-02-06 18:23:55 DEBUG juju-log identity-service:29: 0 section(s) found
2019-02-06 18:23:56 DEBUG juju-log identity-service:29: Generating template context for identity-service
2019-02-06 18:23:56 INFO juju-log identity-service:29: Missing required data: service_port service_host auth_host auth_port admin_tenant_name admin_user admin_password
2019-02-06 18:23:56 INFO juju-log identity-service:29: identity relation’s interface, identity-service, is related awaiting the following data from the relationship: service_port, service_host, auth_host, auth_port, admin_tenant_name, admin_user, admin_password.
root@juju-692f12-0-lxd-7:/var/log/juju# tail unit-nova-cloud-controller-0.log
2019-02-06 18:47:28 DEBUG cloud-compute-relation-changed File “/var/lib/juju/agents/unit-nova-cloud-controller-0/charm/hooks/nova_cc_utils.py”, line 1040, in ssh_compute_add
2019-02-06 18:47:28 DEBUG cloud-compute-relation-changed if ch_ip.ns_query(short):
2019-02-06 18:47:28 DEBUG cloud-compute-relation-changed File “/var/lib/juju/agents/unit-nova-cloud-controller-0/charm/charmhelpers/contrib/network/ip.py”, line 478, in ns_query
2019-02-06 18:47:28 DEBUG cloud-compute-relation-changed answers = dns.resolver.query(address, rtype)
2019-02-06 18:47:28 DEBUG cloud-compute-relation-changed File “/usr/lib/python3/dist-packages/dns/resolver.py”, line 1132, in query
2019-02-06 18:47:28 DEBUG cloud-compute-relation-changed raise_on_no_answer, source_port)
2019-02-06 18:47:28 DEBUG cloud-compute-relation-changed File “/usr/lib/python3/dist-packages/dns/resolver.py”, line 947, in query
2019-02-06 18:47:28 DEBUG cloud-compute-relation-changed raise NoNameservers(request=request, errors=errors)
2019-02-06 18:47:28 DEBUG cloud-compute-relation-changed dns.resolver.NoNameservers: All nameservers failed to answer the query h14. IN A: Server 127.0.0.53 UDP port 53 answered SERVFAIL
2019-02-06 18:47:28 ERROR juju.worker.uniter.operation runhook.go:132 hook “cloud-compute-relation-changed” failed: exit status 1


#3

Update to all who find them selves with this issue.

The juju machines will get there dns-search settings from the maas node.
The LXD containers will get there dns-search settings from the machine.

Remember to add the search option on the maas node even if the nameserver is one of the public ones.

Example:
/etc/netplan/50-cloud-init.yaml:

        nameservers:
            addresses: [1.1.1.1]
            search: [maas]

#4

Awesome, thanks for the heads up.


#5

I’m having the same issue despite adding maas to my nameservers, can I see your entire netplan yaml? I think it’s an issue of me not setting my maas region+rack controller to reference itself as a dns server but I’m a little stumped.

    ethernets:
        enp6s0:
            addresses:
            - 10.2.63.3/24
            dhcp4: false
            gateway4: 10.2.63.1
            nameservers:
                addresses:
                - 1.1.1.1
                search: [maas]
        enp7s0:
            addresses:
            - 10.2.63.4/24
            dhcp4: false
            gateway4: 10.2.63.1
            nameservers:
                addresses:
                - 1.1.1.1
                search: [maas]
    version: 2

#6

Hi,

Except that you have specified the default gateway twice you config seems OK.

Here is mine for reference.
I have a separate network for PXE booting because i am bonding the interfaces on the compute nodes.
The br-private is used for all things Openstack in my case.

network:
	    ethernets:
		eno1:
		    dhcp4: false
		    dhcp6: false
		eno2:
		    dhcp4: false
		    dhcp6: false
	    bridges:
		br-pxe:
		    interfaces: [eno1]
		    dhcp4: false
		    addresses: [192.168.0.2/24]
		    nameservers:
		        addresses: [1.1.1.1]
		        search: [maas]
		br-private:
		    interfaces: [vlan1337]
		    addresses: [192.168.2.2/23]
		    dhcp4: false
		    dhcp6: false
		    gateway4: 192.168.2.1
		    nameservers:
		        addresses: [1.1.1.1]
		        search: [maas]
	    vlans:
		vlan1337:
		    id: 1337
		    link: eno1
		    dhcp4: false
		    dhcp6: false
	    version: 2

These are the relations to NTP:

# neutron-gateway
- - nova-cloud-controller:quantum-network-service
  - neutron-gateway:quantum-network-service
- - ntp:juju-info
  - neutron-gateway:juju-info

# nova-compute
- - nova-cloud-controller:cloud-compute
  - nova-compute:cloud-compute
- - ntp:juju-info
  - nova-compute:juju-info

Best regards
Emil