I’ve read whatever documentation and --help
output I can get from ucd
and ucd-data-fetch
I know that ucd
generates /var/lib/cloud/aws-user-data
when the systemd oneshot runs.
What I want to understand is whether ucd
also fetches the instance hostname
from metadata → the same output that you’d get from curl --silent http://169.254.169.254/latest/meta-data/hostname
on an EC2.
The Ask
When ucd
runs at boot, does it save and/or output that hostname
somewhere?
The reason I ask is because putting curl --silent http://169.254.169.254/latest/meta-data/hostname > /opt/hostname.txt
into a systemd oneshot appears to take about 5 seconds to run, and ucd
is significantly snappier.
See below:
root@ip-10-0-10-170.us-west-2.compute.internal~ # systemd-analyze blame
5.314s set-hostname-metadata.service
1.248s ucd.service
Reason
Even those 5 seconds make a difference in our use-case.
Any help or info would be much appreciated!