Afterburn reports incorrect OpenStack instance id
mdbooth opened this issue · comments
Bug
[root@mbooth-centos-9 ~]# afterburn --provider openstack --attributes afterburn
[root@mbooth-centos-9 ~]# cat afterburn
AFTERBURN_OPENSTACK_INSTANCE_ID=i-062839a6
...
This instance id is meaningless. It is returned by the legacy ec2 metadata service which is deep frozen so we can't even fix it in OpenStack.
The issue is that it's using the wrong metadata endpoint:
afterburn/src/providers/openstack/network.rs
Lines 11 to 12 in f22131c
It should probably be using a pinned version of the openstack metadata, e.g.:
[cloud-user@mbooth-centos-9 ~]$ curl -s http://169.254.169.254/openstack/2018-08-27/meta_data.json | jq
{
"uuid": "4037a55b-bcca-4a53-a596-c0155afe2642",
"public_keys": {
"mbooth-yubikey": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDBoTk3cat4yl1CFTkn75lfWqPWp96gVzpYqpWcLdj3fTUBZC9kFCbkcOkWRSXNB7eWr3ulLEAcyn0byeusT190GQ1rdlSyp6lYX9vLnPYbnfr8JzhX10B8LxSxVxj5JTCqIekBFco+rHO9h3GNF1DCyPIwDfPVl8cpL94g0Id7SVE4wH1GeVIkGoLxgt2R5WNdaxQH3Z4DclvXVwys/FMnkDUC2oTs24oxQMhcinpKaFA12LxWh+vv0+ALoGG6h6m0ka1ELFdHIXULEV5VM4dvMz8GFxvZWGzKHyjiaBsRGhO2takw/E+t/A2cFWhTqCggtK7k0ZEkUXQCbw7W4Q1JainElboCJinPEa7ErLnu0EwfOgIh0IfhyMd1UIAkkd2TAGUmiqpG5QjA/m36m1/CCrOWvyCHftmVOKxICRevzmZVCPSv1DCr3YpYwM7gdPKChACXQ8J4HBcPDNSUVTTHxklUpIqigmpwuZE/ohhs/mYRacPvEPGl+0lbmpuaCMK0e9mmm/0YhUqO9CjMNxShlWOo3hQhOl/kxtMduYmVPpePhE8ZYuaWkpUqVT1FuZ9LZzdWdp74Ero5cSpqHgLWZ7yt7g1JUzyu6xwWeMEQx5vJbD3fC2KBDZUmlica1wLX96dhcXYxjcdxMyGBpeEbScXU5WHJOsIx7DDi9HDu0w== cardno:18 280 175\n"
},
"keys": [
{
"name": "mbooth-yubikey",
"type": "ssh",
"data": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDBoTk3cat4yl1CFTkn75lfWqPWp96gVzpYqpWcLdj3fTUBZC9kFCbkcOkWRSXNB7eWr3ulLEAcyn0byeusT190GQ1rdlSyp6lYX9vLnPYbnfr8JzhX10B8LxSxVxj5JTCqIekBFco+rHO9h3GNF1DCyPIwDfPVl8cpL94g0Id7SVE4wH1GeVIkGoLxgt2R5WNdaxQH3Z4DclvXVwys/FMnkDUC2oTs24oxQMhcinpKaFA12LxWh+vv0+ALoGG6h6m0ka1ELFdHIXULEV5VM4dvMz8GFxvZWGzKHyjiaBsRGhO2takw/E+t/A2cFWhTqCggtK7k0ZEkUXQCbw7W4Q1JainElboCJinPEa7ErLnu0EwfOgIh0IfhyMd1UIAkkd2TAGUmiqpG5QjA/m36m1/CCrOWvyCHftmVOKxICRevzmZVCPSv1DCr3YpYwM7gdPKChACXQ8J4HBcPDNSUVTTHxklUpIqigmpwuZE/ohhs/mYRacPvEPGl+0lbmpuaCMK0e9mmm/0YhUqO9CjMNxShlWOo3hQhOl/kxtMduYmVPpePhE8ZYuaWkpUqVT1FuZ9LZzdWdp74Ero5cSpqHgLWZ7yt7g1JUzyu6xwWeMEQx5vJbD3fC2KBDZUmlica1wLX96dhcXYxjcdxMyGBpeEbScXU5WHJOsIx7DDi9HDu0w== cardno:18 280 175\n"
}
],
"hostname": "mbooth-centos-9",
"name": "mbooth.centos-9",
"launch_index": 0,
"availability_zone": "nova",
"random_seed": "Et5yhE5qtGfTg3Y4+BiKJ1hhj6uQRjprUgxz03BdJpOoINHc16jzbtV47+0byNUc5WUoN3MO4uVsW7iF9cjCrVM3mvdeDzGY7HilvG4ljKt1DIM8V6N9mfe7J+cfCn1W+rAzXHP47yduACsVmmqjax/BUNpP3DSRy7VCm0S3P37preTXGv2bJAQF5G9dt+cTZOup9ABg53VecaFaIoajMny/ggDvbAR6eKjv7gyXe2G9T9r+iZ/B7KHvwPZhgDzvqYhoF+2bB3BtmhNjOrv+Luilpf6jLAiAa/pY1pQIthvjOY1ExN0obl94VZ2T5hAxais47ZpX9GNCXUpqYOu5mIuWi/M8IjF4ubA5bMSKqs10bdgX2AHEASyc5WFiUJekratnt9lCqAQHuo9UgpTbXEFE7Ghw1O52nb14JTQmuvGfKac5I7b3wyHnBNyY9MJ+pemcclN+6B2tm9qKUT44+nyfu8rOSg/vmmsIQ6+WdDXY4Sg4COlnaoeMRwNQlkMdCvz0RhjaWMYJBl7Gtqy68maWeHMsqVw//g45FZyZS0TyY3tYaWlY96uidgWJhuaWeNLvHPDxIB3jW1V664OXMsQ7yVKikEYlx8S4AltjP4FEmp28R8y2Iusn9foyoulO6kW0HipoNXbKguXQ+FBRE0LnM3GAYcO0tmega4NADxk=",
"project_id": "c73b7097d07c46f78eb4b4dcfbac5ca8",
"devices": []
}
Unfortunately that doesn't make local IP information as easy to access (network_info.json doesn't contain IP information), so possibly some mix and match would be in order for local-ipv4 and public-ipv4.
Operating System Version
This is a CentOS 9 mule, afterburn manually installed.
Afterburn Version
This is afterburn-5.4.1-1.el9.x86_64, but also confirmed by code inspection on main.
Just wanted to add that the issue seems to also affect the config-drive version of this. It fetches both the EC2 and OpenStack instance data but for some reason the EC2 is used for the instance ID even though the hostname is taken from the OpenStack data.
Thank you for creating the issue, and all the details. I will mark this as a Jira issue and have it prioritized.