Hi All,

Apologies if that’s not the best place for this…

I am testing the Debian 12 AMI (in eu-west-1 at least) and encountered a weird 
issue:

$ curl http://instance-data/
curl: (6) Could not resolve host: instance-data

The issue stem from resolv.conf lacking the “<region>.compute.internal” domain 
search and instead only has “.”

After digging up I found out thoses images have been migrated to netplan + 
networkd and the default/generated netplan base configurated is lacking the 
required “dhcpv4-override: use-domains: true”.

I tried to apply that change via cloud-init’s user-data with no luck, as far as 
I could see the “local” part of cloud-init is bringing the network up 
“manually”, then fetch ec2 metadata and then setup netplan .. but without using 
the user-data part of the metadata ..

The lovely cherry on top of the cake is that the network brought up before 
netplan actually include the correct domain suffix and is able to resolve 
‘instance-data’:

2023-08-25 14:57:06,175 - util.py[DEBUG]: Resolving URL: http://169.254.169.254 
took 3.865 seconds
2023-08-25 14:57:06,175 - util.py[DEBUG]: Resolving URL: http://[fd00:ec2::254] 
took 0.000 seconds
2023-08-25 14:57:10,175 - util.py[DEBUG]: Resolving URL: 
http://instance-data.:8773 took 4.000 seconds
2023-08-25 14:57:10,175 - DataSourceEc2.py[DEBUG]: Removed the following from 
metadata urls: ['http://instance-data.:8773']

Regards,
Benoit

Reply via email to