Also, since we're already here (tell me if I need to open another issue/question for this), but I'm trying to make a double cloud-init work in my env. However, looking at cloud-init logs I've noticed that the configs are MERGED, not parsed separately! Thus, the ssh-keys specified in one config get rewritten from the other one, as well as giving me other troubles. Log:
-- Logs begin at Fri 2016-09-02 12:41:53 UTC, end at Fri 2016-09-02 12:54:21 UTC. --
Sep 02 12:42:03 localhost coreos-cloudinit[822]: 2016/09/02 12:42:03 Checking availability of "local-file"
Sep 02 12:42:03 localhost coreos-cloudinit[822]: 2016/09/02 12:42:03 Fetching user-data from datasource of type "local-file"
Sep 02 12:42:03 localhost coreos-cloudinit[834]: 2016/09/02 12:42:03 Checking availability of "cloud-drive"
Sep 02 12:42:03 localhost coreos-cloudinit[834]: 2016/09/02 12:42:03 Fetching user-data from datasource of type "cloud-drive"
Sep 02 12:42:03 localhost coreos-cloudinit[834]: 2016/09/02 12:42:03 Attempting to read from "/media/configdrive/openstack/latest/user_data"
Sep 02 12:42:03 localhost coreos-cloudinit[834]: 2016/09/02 12:42:03 Fetching meta-data from datasource of type "cloud-drive"
Sep 02 12:42:03 localhost coreos-cloudinit[834]: 2016/09/02 12:42:03 Attempting to read from "/media/configdrive/openstack/latest/meta_data.json"
Sep 02 12:42:03 localhost coreos-cloudinit[822]: 2016/09/02 12:42:03 Fetching meta-data from datasource of type "local-file"
Sep 02 12:42:03 localhost coreos-cloudinit[834]: 2016/09/02 12:42:03 Parsing user-data as cloud-config
Sep 02 12:42:03 localhost coreos-cloudinit[834]: 2016/09/02 12:42:03 Merging cloud-config from meta-data and user-data
Sep 02 12:42:03 localhost coreos-cloudinit[822]: 2016/09/02 12:42:03 Parsing user-data as cloud-config
Sep 02 12:42:03 localhost coreos-cloudinit[822]: 2016/09/02 12:42:03 Merging cloud-config from meta-data and user-data
Sep 02 12:42:03 cgcoreossimon1 coreos-cloudinit[834]: 2016/09/02 12:42:03 Set hostname to cgcoreossimon1
Sep 02 12:42:03 cgcoreossimon1 coreos-cloudinit[834]: 2016/09/02 12:42:03 Creating user 'test'
Sep 02 12:42:03 cgcoreossimon1 coreos-cloudinit[822]: 2016/09/02 12:42:03 Set hostname to cgcoreossimon1
Sep 02 12:42:03 cgcoreossimon1 coreos-cloudinit[822]: 2016/09/02 12:42:03 Authorized SSH keys for core user
Sep 02 12:42:03 cgcoreossimon1 coreos-cloudinit[822]: 2016/09/02 12:42:03 Writing file to "/etc/sysctl.d/10-enable-arp-notify.conf"
Sep 02 12:42:03 cgcoreossimon1 coreos-cloudinit[822]: 2016/09/02 12:42:03 Wrote file to "/etc/sysctl.d/10-enable-arp-notify.conf"
Sep 02 12:42:03 cgcoreossimon1 coreos-cloudinit[822]: 2016/09/02 12:42:03 Wrote file /etc/sysctl.d/10-enable-arp-notify.conf to filesystem
Sep 02 12:42:03 cgcoreossimon1 coreos-cloudinit[822]: 2016/09/02 12:42:03 Writing file to "/etc/resolv.conf"
Sep 02 12:42:03 cgcoreossimon1 coreos-cloudinit[822]: 2016/09/02 12:42:03 Wrote file to "/etc/resolv.conf"
Sep 02 12:42:03 cgcoreossimon1 coreos-cloudinit[822]: 2016/09/02 12:42:03 Wrote file /etc/resolv.conf to filesystem
Sep 02 12:42:03 cgcoreossimon1 coreos-cloudinit[822]: 2016/09/02 12:42:03 Updated /etc/environment
Sep 02 12:42:03 cgcoreossimon1 coreos-cloudinit[822]: 2016/09/02 12:42:03 Masking unit file "user-configdrive.service"
Sep 02 12:42:03 cgcoreossimon1 coreos-cloudinit[822]: 2016/09/02 12:42:03 Masking unit file "user-configvirtfs.service"
Sep 02 12:42:03 cgcoreossimon1 coreos-cloudinit[822]: 2016/09/02 12:42:03 Masking unit file "user-configdrive.path"
Sep 02 12:42:03 cgcoreossimon1 coreos-cloudinit[822]: 2016/09/02 12:42:03 Masking unit file "media-configdrive.mount"
Sep 02 12:42:03 cgcoreossimon1 coreos-cloudinit[822]: 2016/09/02 12:42:03 Masking unit file "media-configvirtfs.mount"
Sep 02 12:42:03 cgcoreossimon1 coreos-cloudinit[822]: 2016/09/02 12:42:03 Writing unit "xe-linux-distribution.service" to filesystem
Sep 02 12:42:03 cgcoreossimon1 coreos-cloudinit[822]: 2016/09/02 12:42:03 Writing file to "/etc/systemd/system/xe-linux-distribution.service"
Sep 02 12:42:03 cgcoreossimon1 coreos-cloudinit[822]: 2016/09/02 12:42:03 Wrote file to "/etc/systemd/system/xe-linux-distribution.service"
Sep 02 12:42:03 cgcoreossimon1 coreos-cloudinit[822]: 2016/09/02 12:42:03 Wrote unit "xe-linux-distribution.service"
Sep 02 12:42:03 cgcoreossimon1 coreos-cloudinit[822]: 2016/09/02 12:42:03 Ensuring runtime unit file "etcd.service" is unmasked
Sep 02 12:42:03 cgcoreossimon1 coreos-cloudinit[822]: 2016/09/02 12:42:03 Writing drop-in unit "20-cloudinit.conf" to filesystem
Sep 02 12:42:03 cgcoreossimon1 coreos-cloudinit[822]: 2016/09/02 12:42:03 Writing file to "/run/systemd/system/etcd2.service.d/20-cloudinit.conf"
Sep 02 12:42:03 cgcoreossimon1 coreos-cloudinit[822]: 2016/09/02 12:42:03 Wrote file to "/run/systemd/system/etcd2.service.d/20-cloudinit.conf"
Sep 02 12:42:03 cgcoreossimon1 coreos-cloudinit[822]: 2016/09/02 12:42:03 Wrote drop-in unit "20-cloudinit.conf"
Sep 02 12:42:03 cgcoreossimon1 coreos-cloudinit[822]: 2016/09/02 12:42:03 Ensuring runtime unit file "etcd2.service" is unmasked
Sep 02 12:42:03 cgcoreossimon1 coreos-cloudinit[822]: 2016/09/02 12:42:03 Writing drop-in unit "20-cloudinit.conf" to filesystem
Sep 02 12:42:03 cgcoreossimon1 coreos-cloudinit[822]: 2016/09/02 12:42:03 Writing file to "/run/systemd/system/fleet.service.d/20-cloudinit.conf"
Sep 02 12:42:03 cgcoreossimon1 coreos-cloudinit[822]: 2016/09/02 12:42:03 Wrote file to "/run/systemd/system/fleet.service.d/20-cloudinit.conf"
Sep 02 12:42:03 cgcoreossimon1 coreos-cloudinit[822]: 2016/09/02 12:42:03 Wrote drop-in unit "20-cloudinit.conf"
Sep 02 12:42:03 cgcoreossimon1 coreos-cloudinit[822]: 2016/09/02 12:42:03 Ensuring runtime unit file "fleet.service" is unmasked
Sep 02 12:42:03 cgcoreossimon1 coreos-cloudinit[822]: 2016/09/02 12:42:03 Ensuring runtime unit file "locksmithd.service" is unmasked
Sep 02 12:42:03 cgcoreossimon1 coreos-cloudinit[822]: 2016/09/02 12:42:03 Calling unit command "start" on "etcd2.service"'
Sep 02 12:42:03 cgcoreossimon1 coreos-cloudinit[834]: 2016/09/02 12:42:03 Authorized SSH keys for core user
Sep 02 12:42:03 cgcoreossimon1 coreos-cloudinit[834]: 2016/09/02 12:42:03 Writing file to "/etc/sysctl.d/10-enable-arp-notify.conf"
Sep 02 12:42:04 cgcoreossimon1 coreos-cloudinit[834]: 2016/09/02 12:42:04 Wrote file to "/etc/sysctl.d/10-enable-arp-notify.conf"
Sep 02 12:42:04 cgcoreossimon1 coreos-cloudinit[834]: 2016/09/02 12:42:04 Wrote file /etc/sysctl.d/10-enable-arp-notify.conf to filesystem
Sep 02 12:42:04 cgcoreossimon1 coreos-cloudinit[834]: 2016/09/02 12:42:04 Writing file to "/tmp/custom-cloud-config-bootstrap.sh"
Sep 02 12:42:04 cgcoreossimon1 coreos-cloudinit[834]: 2016/09/02 12:42:04 Wrote file to "/tmp/custom-cloud-config-bootstrap.sh"
Sep 02 12:42:04 cgcoreossimon1 coreos-cloudinit[834]: 2016/09/02 12:42:04 Wrote file /tmp/custom-cloud-config-bootstrap.sh to filesystem
Sep 02 12:42:04 cgcoreossimon1 coreos-cloudinit[834]: 2016/09/02 12:42:04 Updated /etc/environment
Sep 02 12:42:04 cgcoreossimon1 coreos-cloudinit[834]: 2016/09/02 12:42:04 Writing unit "xe-linux-distribution.service" to filesystem
Sep 02 12:42:04 cgcoreossimon1 coreos-cloudinit[834]: 2016/09/02 12:42:04 Writing file to "/etc/systemd/system/xe-linux-distribution.service"
Sep 02 12:42:04 cgcoreossimon1 coreos-cloudinit[834]: 2016/09/02 12:42:04 Wrote file to "/etc/systemd/system/xe-linux-distribution.service"
Sep 02 12:42:04 cgcoreossimon1 coreos-cloudinit[834]: 2016/09/02 12:42:04 Wrote unit "xe-linux-distribution.service"
Sep 02 12:42:04 cgcoreossimon1 coreos-cloudinit[834]: 2016/09/02 12:42:04 Writing unit "cryptogate-cloud-config-bootstrap.service" to filesystem
Sep 02 12:42:04 cgcoreossimon1 coreos-cloudinit[834]: 2016/09/02 12:42:04 Writing file to "/etc/systemd/system/cryptogate-cloud-config-bootstrap.service"
Sep 02 12:42:04 cgcoreossimon1 coreos-cloudinit[834]: 2016/09/02 12:42:04 Wrote file to "/etc/systemd/system/cryptogate-cloud-config-bootstrap.service"
Sep 02 12:42:04 cgcoreossimon1 coreos-cloudinit[834]: 2016/09/02 12:42:04 Wrote unit "cryptogate-cloud-config-bootstrap.service"
Sep 02 12:42:04 cgcoreossimon1 coreos-cloudinit[834]: 2016/09/02 12:42:04 Ensuring runtime unit file "etcd.service" is unmasked
Sep 02 12:42:04 cgcoreossimon1 coreos-cloudinit[834]: 2016/09/02 12:42:04 Ensuring runtime unit file "etcd2.service" is unmasked
Sep 02 12:42:04 cgcoreossimon1 coreos-cloudinit[834]: 2016/09/02 12:42:04 Ensuring runtime unit file "fleet.service" is unmasked
Sep 02 12:42:04 cgcoreossimon1 coreos-cloudinit[834]: 2016/09/02 12:42:04 Ensuring runtime unit file "locksmithd.service" is unmasked
Sep 02 12:42:04 cgcoreossimon1 coreos-cloudinit[834]: 2016/09/02 12:42:04 Calling unit command "start" on "xe-linux-distribution.service"'
Sep 02 12:42:04 cgcoreossimon1 coreos-cloudinit[834]: 2016/09/02 12:42:04 Result of "start" on "xe-linux-distribution.service": done
Sep 02 12:42:04 cgcoreossimon1 coreos-cloudinit[834]: 2016/09/02 12:42:04 Calling unit command "start" on "cryptogate-cloud-config-bootstrap.service"'
Sep 02 12:42:04 cgcoreossimon1 coreos-cloudinit[834]: 2016/09/02 12:42:04 Result of "start" on "cryptogate-cloud-config-bootstrap.service": done
I've got the following cloud-configs: Initial cloud-config required by XenOrchestra with an added bash script for proper etcd2 setup: config_xo.txt And then the 'real' dynamically created cloud-config here (well....this one wouldn't properly work, but it makes my thought easier to understand): config_real.txt
As you can see the bash script from the XO cloud-config uses a rather crude way of executing specific parts. Idealy, I would like not to do the partprobe thing and just parse the XO config on the first boot, run the custom script which installs the system with a specific local user-data file. Inside that new local cloud-config would be declarations of masked media-drive and other units. So that, upon reboot, right after install, the OS would parse the local config, turn off units (specifically the open-stack cloud drive service) and continue with the boot process without executing the initial XO cloud config once again.
Is this possible? Or maybe there is a better/different way of acomplishing this?
Also, since we're already here (tell me if I need to open another issue/question for this), but I'm trying to make a double cloud-init work in my env. However, looking at cloud-init logs I've noticed that the configs are MERGED, not parsed separately! Thus, the ssh-keys specified in one config get rewritten from the other one, as well as giving me other troubles. Log:
I've got the following cloud-configs: Initial cloud-config required by XenOrchestra with an added bash script for proper etcd2 setup: config_xo.txt And then the 'real' dynamically created cloud-config here (well....this one wouldn't properly work, but it makes my thought easier to understand): config_real.txt
As you can see the bash script from the XO cloud-config uses a rather crude way of executing specific parts. Idealy, I would like not to do the
partprobe
thing and just parse the XO config on the first boot, run the custom script which installs the system with a specific localuser-data
file. Inside that new local cloud-config would be declarations of masked media-drive and other units. So that, upon reboot, right after install, the OS would parse the local config, turn off units (specifically the open-stack cloud drive service) and continue with the boot process without executing the initial XO cloud config once again.Is this possible? Or maybe there is a better/different way of acomplishing this?
Thanks, Simon