Ask Your Question
1

Openstack metadata - Why I am not able to access to the metadata?

asked 2018-02-20 10:04:32 -0500

scampo gravatar image

Hi all,

I'm new to Openstack metadata services and I'm trying to play with them.

I am working with Mitaka. As suggested in the official documentation (https://docs.openstack.org/nova/latest/admin/networking-nova.html#metadata-service (https://docs.openstack.org/nova/lates...)) I checked my nova.conf file and I successfully tried to curl as shown below:

curl http://192.168.1.1:8775
1.0
2007-01-19
2007-03-01
..........

The problem occured when I tried to access the other subdirectories.

For Instance, if I try to make a curl asking the metadata in 2007-01-19 , I get the a 400 Bad Request error.

Why? Any tips?

Thank you!

edit retag flag offensive close merge delete

Comments

Can you share neutron meta data server logs

Radhakrishnan Rk gravatar imageRadhakrishnan Rk ( 2018-02-24 05:48:17 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
2

answered 2018-02-20 14:39:59 -0500

doka.ua gravatar image

updated 2018-02-20 15:19:52 -0500

400 Bad Request
X-Instance-ID header is missing from request.

Metadata is available from VM and accessible through metadata proxy, which poplulates request with instance ID and gives metadata server clues which metadata return in answer. Metadat proxy, in general, is accessible on address 169.254.169.254 and pinned either to DHCP or VR entity of the VM's subnet depending on configuration (neutron/dhcp_agent.ini, neutron/l3_agent.ini), e.g.

VM$ netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
169.254.169.254 25.1.4.10       255.255.255.255 UGH       0 0          0 eth0

where in example 25.1.4.10 is DHCP server of eth0's subnet.

If you'll try to access metadata from inside of your VM, you will get what you're looking for:

VM$ curl http://169.254.169.254/2007-01-19/meta-data/
ami-id
ami-launch-index
ami-manifest-path
hostname
instance-id
local-hostname
local-ipv4
public-hostname
public-ipv4
reservation-id
edit flag offensive delete link more

Comments

1

Thank you! I'll give you a feedback asap!

scampo gravatar imagescampo ( 2018-02-21 08:57:32 -0500 )edit

Thank you @doka.ua !

The problem was that I was not trying to access metadata in the correct way. I tried from Controller Node and Compute Node before starting VMs, obtaining the initial error.

Thank you very much

scampo gravatar imagescampo ( 2018-02-28 04:51:56 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2018-02-20 10:04:32 -0500

Seen: 1,550 times

Last updated: Feb 20 '18