cant ssh into instance using key..

asked 2016-12-12 03:38:39 -0500

vathanlal gravatar image

updated 2016-12-14 07:06:44 -0500

Hi, I have a newton Openstack cluster.. I can successfully launch instance and ping the instance.. I can even ssh into my cirros instance using default userid and password.. I launched a centos and ubuntu instances from its cloud image.. But I cant ssh into these instance using the key generated.. I can ping its floating Ip successfully but cant ssh into it.. Please help.. Iam getting error like below for all time

The authenticity of host '141.30.74.137 (141.30.74.137)' can't be established.
ECDSA key fingerprint is SHA256:pqroB0RkIuVa+KBL03Zqu5a205aW/Onl2r6g7Ezx2IA.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '141.30.74.137' (ECDSA) to the list of known hosts.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

Iam getting the error below in my console.log of ubuntu and centos image

[  126.984857] cloud-init[992]: 2016-12-13 17:50:48,502 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [112/120s]: bad status code [404]
[  134.005640] cloud-init[992]: 2016-12-13 17:50:55,523 - url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [119/120s]: request error [HTTPConnectionPool(host='169.254.169.254', port=80): Max retries exceeded with url: /2009-04-04/meta-data/instance-id (Caused by NewConnectionError('<requests.packages.urllib3.connection.HTTPConnection object at 0x7fcb3ff9eb70>: Failed to establish a new connection: [Errno 115] Operation now in progress',))]
[  141.027066] cloud-init[992]: 2016-12-13 17:51:02,540 - DataSourceEc2.py[CRITICAL]: Giving up on md from ['http://169.254.169.254/2009-04-04/meta-data/instance-id'] after 126 seconds
atus code [404]
[  257.601354] cloud-init[992]: 2016-12-13 17:52:59,118 - url_helper.py[WARNING]: Calling 'http://192.168.1.2/latest/meta-data/instance-id' failed [116/120s]: bad status code [404]
[  264.612128] cloud-init[992]: 2016-12-13 17:53:06,126 - DataSourceCloudStack.py[CRITICAL]: Giving up on waiting for the metadata from ['http://192.168.1.2/latest/meta-data/instance-id'] after 123 seconds
[  268.372436] cloud-init[992]: Generating public/private rsa key pair.
[  268.375389] cloud-init[992]: Your identification has been saved in /etc/ssh/ssh_host_rsa_key.
[  268.381998] cloud-init[992]: Your public key has been saved in /etc/ssh/ssh_host_rsa_key.pub.
[  268.388591] cloud-init[992]: The key fingerprint is:
edit retag flag offensive close merge delete

Comments

A few suggestions: Run ssh with -v or -vv or -vvv. Check if the instance has a copy of the public key. Check if it can access the metadata API or config drive. Run neutron agent-list to check if the metadata agent is up.

Bernd Bausch gravatar imageBernd Bausch ( 2016-12-12 09:15:05 -0500 )edit

try

 ssh-keygen -R 141.30.74.137

then

 ssh -v -i your_key.pem centos@141.30.74.137
yas gravatar imageyas ( 2016-12-12 11:26:26 -0500 )edit

I used openstack keypair create --public-key ~/.ssh/id_rsa.pub mykey to generate the key.. From where I will get mykey.pem..??

vathanlal gravatar imagevathanlal ( 2016-12-14 07:03:05 -0500 )edit

As far as I see your cloud VMs fail to connect Nova Metadata Server ( openstack-nova-api ) on Controller. Openstack Nodes Cluster is misconfigured

dbaxps gravatar imagedbaxps ( 2016-12-14 08:45:43 -0500 )edit

How can I find where the misconfiguration is?? I asked this as a question in https://ask.openstack.org/en/question/100373/metadata-server-is-not-reachable-404-error/ (https://ask.openstack.org/en/question...)

vathanlal gravatar imagevathanlal ( 2016-12-14 08:53:46 -0500 )edit