Ask Your Question
0

(centOS) cloud-init not pulling ssh

asked 2015-11-06 09:25:02 -0500

snd lt gravatar image

Trying to build CentOS 6 qcow2 image with OpenStack guide[http://docs.openstack.org/image-guide/content/centos-image.html]. I'm using "cloud-init" instead of the "/etc/rc.d/rc.local" script but I assume "cloud-init" overrides the script? I successfully created the image, uploaded and created the instance. But can't ssh into it. I suspect that the instance is not pulling ssh public key from the OpenStack server/controller.

These are the logs I get from OpenStack admin page.

ci-info: ++++++++++++++++++++++++++++++Route info++++++++++++++++++++++++++++++
ci-info: +-------+-------------+----------+---------------+-----------+-------+
ci-info: | Route | Destination | Gateway  |    Genmask    | Interface | Flags |
ci-info: +-------+-------------+----------+---------------+-----------+-------+
ci-info: |   0   |   10.6.1.0  | 0.0.0.0  | 255.255.255.0 |    eth0   |   U   |
ci-info: |   1   |   0.0.0.0   | 10.6.1.1 |    0.0.0.0    |    eth0   |   UG  |
ci-info: +-------+-------------+----------+---------------+-----------+-------+
Starting cloud-init: Cloud-init v. 0.7.5 running 'modules:config' at Thu, 05 Nov 2015 23:55:05 +0000. Up 15.43 seconds.
Starting cloud-init: Cloud-init v. 0.7.5 running 'modules:final' at Thu, 05 Nov 2015 23:55:06 +0000. Up 17.00 seconds.
ci-info: ++++++++++Authorized keys from /home/centos/.ssh/authorized_keys for user centos+++++++++++
ci-info: +---------+-------------------------------------------------+---------+-------------------+
ci-info: | Keytype |                Fingerprint (md5)                | Options |      Comment      |
ci-info: +---------+-------------------------------------------------+---------+-------------------+
ci-info: | ssh-rsa | d7:78:f4:82:71:f8:cd:4e:75:d9:ca:fd:57:f6:74:82 |    -    | Generated-by-Nova |
ci-info: +---------+-------------------------------------------------+---------+-------------------+
ec2: 
ec2: #############################################################
ec2: -----BEGIN SSH HOST KEY FINGERPRINTS-----
ec2: 1024 a2:e1:7a:5d:9a:2b:83:4e:a8:07:90:6b:a2:9a:bf:19 /etc/ssh/ssh_host_dsa_key.pub (DSA)
ec2: 2048 8b:fc:3e:4a:a3:bb:3c:52:3f:a0:13:56:29:7a:d6:bb /etc/ssh/ssh_host_key.pub (RSA1)
ec2: 2048 6e:c2:99:cd:59:98:a3:d9:06:1c:ae:f9:d1:e6:56:10 /etc/ssh/ssh_host_rsa_key.pub (RSA)
ec2: -----END SSH HOST KEY FINGERPRINTS-----
ec2: #############################################################
-----BEGIN SSH HOST KEY KEYS-----
2048 35 32313190688033058191298985530558350409552981243503755532029861426754427614850471780051595180844003086009 
ssh-rsa 888WVD3T7cf/CN94GG4bLV66NIedXmdit1fpRxEOx7idyCOXsfi/53D7Lo7Ez+kqZAe4HGo0JSQ== 
-----END SSH HOST KEY KEYS-----
Cloud-init v. 0.7.5 finished at Thu, 05 Nov 2015 23:55:06 +0000. Datasource DataSourceConfigDriveNet [net,ver=2][source=/dev/sr0].  Up 17.20 seconds
Starting postfix: [  OK  ]
Starting crond: [  OK  ]

CentOS release 6.6 (Final)
Kernel 2.6.32-504.el6.x86_64 on an x86_64

demo-centos login:

These are my config files for some important files.

[/etc/sudoers]

##
## Allow root to run any commands anywhere 
root    ALL=(ALL)       ALL
centos ALL = (ALL) NOPASSWD: ALL
## Allows members of the 'sys' group to run networking, software, 
## service management apps and more.
# %sys ALL = NETWORKING, SOFTWAR

[/etc/cloud/cloud.cfg]

system_info:
  default_user:
    name: centos
    lock_passwd: true
    gecos: Cloud User
    groups: [wheel, adm]
    sudo: ["ALL=(ALL) NOPASSWD:ALL"]
    shell: /bin/bash
  distro: rhel
  paths:


[/boot/grub/menu.lst]
   grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE:  You have a /boot partition.  This means that
#          all kernel and initrd paths are relative to /boot/, eg.
#          root (hd0,0)
#          kernel /vmlinuz-version ro root=/dev/sda3
#          initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0 ...
(more)
edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2015-11-08 00:20:12 -0500

Bipin gravatar image

Hello,

Most probably instance is not getting metadata, so you have to add rule in your security group. Allow traffic for Egress to port 80. It will work.

Regards

edit flag offensive delete link more

Comments

Yes, already have images in and instances running. This is a new approach/attempt where we are creating a CentOS from scratch. There already are security groups formed and working, perhaps I didn't define my cloud-init settings right? user permissions, etc? Thanks.

snd lt gravatar imagesnd lt ( 2015-11-09 07:32:11 -0500 )edit
0

answered 2015-11-07 22:09:56 -0500

wmriver gravatar image

Might be a dumb question, but do you have the port open via security groups?

edit flag offensive delete link more

Comments

Yes, already have images in and instances running. This is a new approach/attempt where we are creating a CentOS from scratch. There already are security groups formed and working, perhaps I didn't define my cloud-init settings right? user permissions, etc? Thanks.

snd lt gravatar imagesnd lt ( 2015-11-09 07:32:17 -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: 2015-11-06 09:24:24 -0500

Seen: 971 times

Last updated: Nov 08 '15