When you run :-
# source keystonerc_demo
# nova keypair-add oskey01 > oskey01.pem
# chmod 600 *.pem
SSH RSA public key gets uploaded to Nova and may be used when you launch the VM
It would be written by default to ~fedora/.ssh/authorized_keys ( as far as I remember ) on your VM
when it comes to ACTIVE state
# nova keypair-list
shows this public rsa key been generated by nova command.
SSH RSA private key gets written to oskey01.pem
No hackery is needed to connect to VM via it's FIP
$ ssh -i oskey01.pem fedora@VM's floating-ip
Hi All,
I have installed OpenStack (i.e., openstack-mitaka release) on CentOS7.2 . Used Fedora20 qcow2 cloud image for creating a VM using Dashboard.
1) Installed “libguestfs” on Nova compute node.
2) Updated these lines in “/etc/nova/nova.conf ”
inject_password=true
inject_key=true
inject_partition=-1
3) Restarted nove-compute: # service openstack-nova-compute restart
4) Enabled setting root password in /usr/share/openstack-dashboard/openstack_dashboard/local/local_settings.py
OPENSTACK_HYPERVISOR_FEATURES = {
…..
‘can_set_password’: True,
}
5) Placed the below code in “Customization Script” section of the Launch Instance dialog box in OpenStack.
#cloud-config
ssh_pwauth: True
chpasswd:
list: |
root: root
expire: False
runcmd:
- [ sh, -c, echo "=========hello world'=========" ]
It appears that, when the instance was launched, cloud-init did not change the password for root user, and I was not able to log in to the instance’s console (Dashboard) using username (root) and password (root). it says “Log in incorrect”.
Upon checking the boot log found that, cloud-init has executed /var/lib/cloud/instance/scripts/runcmd and printed hello world. Can anyone please let me know where I am wrong ? Thanks in advance for your support and time.
Regards,
Chinmaya