Comment 4 for bug 2003048

Revision history for this message
Huijuan Zhao (huijuanzhao) wrote :

> Do either of these cloud-configs work for you?
Using dhclient:
$ cat /etc/cloud/cloud.cfg.d/network_cu.cfg
#cloud-config
write_files:
  - path: /etc/dhcp/dhclient.conf
    content: |
      append domain-search "example.com";
      append domain-name-servers 1.1.1.1;
    owner: root:root
    encoding: text/plain
    append: true
    defer: false

We use /etc/dhcp/dhclient.conf in my distro(rhel). I tested this scenario, it only works during instance first boot. It means users need to add this file /etc/cloud/cloud.cfg.d/network_cu.cfg to image, deploy and boot instance(write content to dhclient.conf), then reboot instance, now can make the new added DNS available(adding to /etc/resolv.conf).

But in this user's scenario, they would like to modify DNS in a booted instance, then reboot instance, make the modified DNS available.

So seems using /etc/cloud/cloud.cfg.d/xx.cfg is NOT a good workaround for this scenario.

Any thoughts?

Thanks!