Ask Your Question
0

Could not retrieve public key from instance metadata, retrying in 5 seconds...

asked 2014-04-16 06:43:21 -0500

Manikantan gravatar image

I am getting error like this "Could not retrieve public key from instance metadata (attempt #2/30), retrying in 5 seconds..." in instance console log. I am running multi host setup (1 controller node, 1 compute node and 1 network node). Have configured metadata host and port configured to talk to metadata server running in controller node. When I run "curl http://169.254.169.254/openstack%22 (http://169.254.169.254/openstack") in compute node - getting 404 not found error. From the VM instance that launches, couldn't ping "169.254.169.254". Except few common settings - different article on the net talk about different settings - tried many of whatever referred, no luck. Running Havana with Neutron.

Any pointers to solve accessing instance thru key authentication - appreciate.

Thanks, Mani

edit retag flag offensive close merge delete

Comments

Quote From the VM instance that launches, couldn't ping "169.254.169.254".

You are not supposed to be able ping "169.254.169.254" from VM

Can you run inside VM ( a kind of ) ?
ubuntu@ubuntutrs0416:~$ curl http://169.254.169.254/openstack/latest/meta_data.json | tee meta_data.json
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1295  100  1295    0     0    858      0  0:00:01  0:00:01 --:--:--   867
{"random_seed": "rRxPqC4itso. . . . . lsNrx3RKCDGDh6vigZg3W1FDqf/x0C78e9oU=", "uuid": "3d5a0418-c24c-4cce-b46a-7c50c2aa3921", "availability_zone": "nova", "hostname": "ubuntutrs0416.novalocal", "launch_index": 0, "public_keys": {"oskey25": "ssh-rsa AAAAB3Nz. . . .  . . . y5jnqRFVvwgXy6ugLs+cpCDokdYdij Generated by Nova\n"}, "name": "UbuntuTRS0416"}
dbaxps gravatar imagedbaxps ( 2014-04-16 12:38:33 -0500 )edit
root@network1:~# neutron router-list
+--------------------------------------+------------+-----------------------------------------------------------------------------+
| id                                   | name       | external_gateway_info                                                       |
+--------------------------------------+------------+-----------------------------------------------------------------------------+
| 547e7f37-c854-4dcc-bdac-c67cdc5dfe83 | Internal   | {"network_id": "b32c80a5-7366-4994-a139-0a98bbbea181", "enable_snat": true} |
| ca917764-ce9e-425b-a958-a811025c6ea3 | TA_Router1 | null                                                                        |
+--------------------------------------+------------+-----------------------------------------------------------------------------+

root@network1:~# ip netns list | grep 547e7f37-c854-4dcc-bdac-c67cdc5dfe83
qrouter-547e7f37-c854-4dcc-bdac-c67cdc5dfe83

root@network1:~# ip netns list | grep ca917764-ce9e-425b-a958-a811025c6ea3
qrouter-ca917764-ce9e-425b-a958-a811025c6ea3

root@network1:~# ip netns exec qrouter-547e7f37-c854-4dcc-bdac-c67cdc5dfe83 iptables -L -t nat | grep 169
REDIRECT   tcp  --  anywhere             169.254.169.254      tcp dpt:http redir ports 8775
SNAT       all  --  169.254.169.252/30   anywhere             to:10.100.6.102

root@network1:~# ip netns exec qrouter-ca917764-ce9e-425b-a958-a811025c6ea3 iptables -L -t nat | grep 169
REDIRECT   tcp  --  anywhere             169.254.169.254      tcp dpt:http redir ports 8775

root@network1:~# ip netns exec qrouter-547e7f37-c854-4dcc-bdac-c67cdc5dfe83 netstat -lntp | grep port_number
root@network1:~# ip netns exec qrouter-ca917764-ce9e-425b-a958-a811025c6ea3 netstat -lntp | grep port_number

I got no output for the grep port_number command mentioned above.

Manikantan gravatar imageManikantan ( 2014-04-16 13:05:45 -0500 )edit

From within the VM launched,

[root@host-10-10-10-103 ~]# curl http://169.254.169.254/openstack/latest/meta_data.json | tee meta_data.json

curl: (7) couldn't connect to host
Manikantan gravatar imageManikantan ( 2014-04-16 13:09:44 -0500 )edit

Please, format your output or place carriage return at the end of line. port_number should be 8775
ip netns exec qrouter-ca917764-ce9e-425b-a958-a811025c6ea3 netstat -lntp | grep 8775
ip netns exec qrouter-547e7f37-c854-4dcc-bdac-c67cdc5dfe83 netstat -lntp | grep 8775
netstat -lntp | grep 8775

dbaxps gravatar imagedbaxps ( 2014-04-16 13:44:19 -0500 )edit

@dbaxps use the space for answers to give answers. You can also edit it later. @Manikantan edit your question to make it more precise.

smaffulli gravatar imagesmaffulli ( 2014-04-18 10:15:27 -0500 )edit

2 answers

Sort by ยป oldest newest most voted
0

answered 2014-05-22 03:32:18 -0500

Manikantan gravatar image

Able to launch instance successfully and login using Key Authentication. Able to see in instance log that it imports the key we provided during launching.

Are there any where OS images with Cloud-init package installed - can be downloaded? Or some steps on how to install cloud-init on the OS image we download from the internet?

Thanks, Mani

edit flag offensive delete link more

Comments

Actually, you are asking new question. Please, post it separately. Answer will be as follows :-
How to create:- http://openstack.redhat.com/Creating_...
Ready ones :- http://openstack.redhat.com/Image_res...

dbaxps gravatar imagedbaxps ( 2014-05-22 03:48:50 -0500 )edit
0

answered 2014-04-16 11:39:34 -0500

dbaxps gravatar image

updated 2014-04-18 10:15:59 -0500

smaffulli gravatar image

Have configured metadata host and port configured to talk to metadata server running in controller node.

Could you run on this host commands like bellow :-
[root@dfw02 ~(keystone_admin)]$ neutron router-list
+--------------------------------------+---------+-----------------------------------------------------------------------------+
| id                                   | name    | external_gateway_info                                                       |
+--------------------------------------+---------+-----------------------------------------------------------------------------+
| 86b3008c-297f-4301-9bdc-766b839785f1 | router2 | {"network_id": "780ce2f3-2e6e-4881-bbac-857813f9a8e0", "enable_snat": true} |
| bf360d81-79fb-4636-8241-0a843f228fc8 | router1 | {"network_id": "780ce2f3-2e6e-4881-bbac-857813f9a8e0", "enable_snat": true} |
+--------------------------------------+---------+-----------------------------------------------------------------------------+
[root@dfw02 ~(keystone_admin)]$ ip netns list | grep 86b3008c-297f-4301-9bdc-766b839785f1
qrouter-86b3008c-297f-4301-9bdc-766b839785f1
[root@dfw02 ~(keystone_admin)]$ ip netns list | grep bf360d81-79fb-4636-8241-0a843f228fc8
qrouter-bf360d81-79fb-4636-8241-0a843f228fc8
[root@dfw02 ~(keystone_admin)]$  ip netns exec qrouter-86b3008c-297f-4301-9bdc-766b839785f1  iptables -L -t nat | grep 169
[root@dfw02 ~(keystone_admin)]$  ip netns exec qrouter-bf360d81-79fb-4636-8241-0a843f228fc8  iptables -L -t nat | grep 169

If you will get some port_number, my next question is following outputs ( for ever routers namespace and on Controller)

[root@dfw02 ~(keystone_admin)]$ ip netns exec qrouter-86b3008c-297f-4301-9bdc-766b839785f1  netstat -lntp | grep port_number
[root@dfw02 ~(keystone_admin)]$ ip netns exec qrouter-bf360d81-79fb-4636-8241-0a843f228fc8  netstat -lntp | grep port_number
root@dfw02 ~(keystone_admin)]$ netstat -lntp | grep port_number
edit flag offensive delete link more

Comments

Launched an Ubuntu instance from Openstack and logged into it using password authentication. When tried : [root@host-10-10-10-102 ~]# curl http://169.254.169.254 curl: (7) couldn't connect to host

169.254.169.254 is pinging since I have added route entry (ip route add 169.254.169.254/32 via 10.10.10.1). Still CURL given above returns can't find host. Can anyone update how to approach this problem? Thanks,Mani

Manikantan gravatar imageManikantan ( 2014-05-21 00:21:52 -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: 2014-04-16 06:43:21 -0500

Seen: 1,819 times

Last updated: May 22 '14