Changing the DNS after microstack.init has been run is more difficult than it should be

Bug #1851863 reported by Pen Gale
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
MicroStack
Confirmed
Wishlist
Unassigned

Bug Description

microstack.init reads the value of config.network.dns, then writes it into $SNAP_COMMON/etc/neutron/dhcp_agent.ini

To change that value later, you need to:
1) Update the value of config.network.dns
2) Hand edit dhcp_agent.ini
3) Restart the snap

Instead, you should be able to:
1) Update the value of config.network.dns (possibly via a wrapper)
2) Invoke microstack.init in such a way that it will update the file and restart just the services that need a restart (possibly the wrapper above handles this, too)

The work involved is:
1) Refactor microstack_init to write dhcp_agent.ini via a template, rather than writing it directly in the init script.
2) Write the wrapper/add hooks to microstack.init to enable the above.

Pen Gale (pengale)
Changed in microstack:
importance: Undecided → Medium
status: New → Confirmed
Pen Gale (pengale)
Changed in microstack:
importance: Medium → Wishlist
Revision history for this message
Peter Matulis (petermatulis) wrote :

I can't get this to work at all.

sudo snap set microstack config.network.dns-servers=10.246.112.3

The snap was restarted:

$ sudo snap restart microstack

The procedure was confirmed:

$ sudo snap get microstack config.network.dns-servers
10.246.112.3

A VM was created:

$ microstack launch cirros -n test

But the nameserver does not change from the default of 1.1.1.1 :

$ ssh -i /home/ubuntu/snap/microstack/common/.ssh/id_microstack cirros@10.20.20.85 cat /etc/resolv.conf

search bad
nameserver 1.1.1.1

I'm not sure why dhcp_agent.ini needs to also be created but I tried it, in addition to all the above:

$ cat /var/snap/microstack/common/etc/neutron/dhcp_agent.ini

[DEFAULT]

interface_driver = openvswitch
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
enable_isolated_metadata = True
dnsmasq_dns_servers = 10.246.112.3

This was followed by a restart of the snap, as before. No change was observed upon the creation of a new VM.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.