pellaeon / bsd-cloudinit

cloud-init scripts for BSD
Apache License 2.0
103 stars 27 forks source link

cloud-init fails to reconfigure hostname when launched in new instance #31

Open ryanpq opened 5 years ago

ryanpq commented 5 years ago

In the DigitalOcean cloud we have found that if a snapshot image is created from a vm with FreeBSD + cloud-init, instances created using that image will fail to use the hostname provided in ConfigDrive resulting in the hostname from the original system continuing to be used.

It appears that if a prior run is found, changes to the ConfigDrive configuration are not read and used.

We do not see this from other ports of cloud-init on Linux distributions.

ryanpq commented 5 years ago

Jan 28 19:04:40 freebsd-s-4vcpu-8gb-nyc1-01 [CLOUDINIT] util.py[DEBUG]: Cloud-init v. 0.7.6 running 'init' at Mon, 28 Jan 2019 19:04:40 +0000. Up Jan 28 19:04:40 freebsd-s-4vcpu-8gb-nyc1-01 [CLOUDINIT] util.py[DEBUG]: Changing the ownership of /var/log/cloud-init.log to 0:0 Jan 28 19:04:40 freebsd-s-4vcpu-8gb-nyc1-01 [CLOUDINIT] util.py[DEBUG]: Running command ['netstat', '-rn'] with allowed return codes [0] (shell=Fa Jan 28 19:04:40 freebsd-s-4vcpu-8gb-nyc1-01 [CLOUDINIT] cloud-init[DEBUG]: Exiting early due to the existence of [('/var/lib/cloud/instance/obj.pk Jan 28 19:04:44 freebsd-s-4vcpu-8gb-nyc1-01 [CLOUDINIT] util.py[DEBUG]: Cloud-init v. 0.7.6 running 'modules:config' at Mon, 28 Jan 2019 19:04:44 ' from '/usr/local/lib/python2.7/site-packages/cloudinit/config/cc_ssh_import_id.pyc'>) with frequency once-per-instance ocal/lib/python2.7/site-packages/cloudinit/config/cc_locale.pyc'>) with frequency once-per-instance Jan 28 19:04:45 freebsd-s-4vcpu-8gb-nyc1-01 [CLOUDINIT] util.py[DEBUG]: Cloud-init v. 0.7.6 running 'modules:final' at Mon, 28 Jan 2019 19:04:45 + Jan 28 19:04:45 freebsd-s-4vcpu-8gb-nyc1-01 [CLOUDINIT] stages.py[DEBUG]: Running module rightscale_userdata (<module 'cloudinit.config.cc_rightsc ale_userdata' from '/usr/local/lib/python2.7/site-packages/cloudinit/config/cc_rightscale_userdata.pyc'>) with frequency once-per-instance r_once' from '/usr/local/lib/python2.7/site-packages/cloudinit/config/cc_scripts_per_once.pyc'>) with frequency once Jan 28 19:04:45 freebsd-s-4vcpu-8gb-nyc1-01 [CLOUDINIT] helpers.py[DEBUG]: config-scripts-per-once already ran (freq=once) Jan 28 19:04:45 freebsd-s-4vcpu-8gb-nyc1-01 [CLOUDINIT] stages.py[DEBUG]: Running module scripts-per-boot (<module 'cloudinit.config.cc_scripts_pe r_boot' from '/usr/local/lib/python2.7/site-packages/cloudinit/config/cc_scripts_per_boot.pyc'>) with frequency always Jan 28 19:04:45 freebsd-s-4vcpu-8gb-nyc1-01 [CLOUDINIT] helpers.py[DEBUG]: Running config-scripts-per-boot using lock (<cloudinit.helpers.DummyLoc k object at 0x8092b9850>) Jan 28 19:04:45 freebsd-s-4vcpu-8gb-nyc1-01 [CLOUDINIT] stages.py[DEBUG]: Running module scripts-per-instance (<module 'cloudinit.config.cc_script s_per_instance' from '/usr/local/lib/python2.7/site-packages/cloudinit/config/cc_scripts_per_instance.pyc'>) with frequency once-per-instance Jan 28 19:04:45 freebsd-s-4vcpu-8gb-nyc1-01 [CLOUDINIT] helpers.py[DEBUG]: config-scripts-per-instance already ran (freq=once-per-instance) Jan 28 19:04:45 freebsd-s-4vcpu-8gb-nyc1-01 [CLOUDINIT] stages.py[DEBUG]: Running module scripts-user (<module 'cloudinit.config.cc_scripts_user' from '/usr/local/lib/python2.7/site-packages/cloudinit/config/cc_scripts_user.pyc'>) with frequency once-per-instance Jan 28 19:04:45 freebsd-s-4vcpu-8gb-nyc1-01 [CLOUDINIT] helpers.py[DEBUG]: config-scripts-user already ran (freq=once-per-instance) Jan 28 19:04:45 freebsd-s-4vcpu-8gb-nyc1-01 [CLOUDINIT] stages.py[DEBUG]: Running module ssh-authkey-fingerprints (<module 'cloudinit.config.cc_ss h_authkey_fingerprints' from '/usr/local/lib/python2.7/site-packages/cloudinit/config/cc_ssh_authkey_fingerprints.pyc'>) with frequency once-per-i nstance