________________________________
From: Chinmaya Dwibedy <ckdwibedy(a)gmail.com>
Sent: Friday, May 27, 2016 7:31 AM
To: Boris Derzhavets
Cc: rdo-list(a)redhat.com
Subject: Re: [rdo-list] Unable to log in to the VM instance’s console using
openstack-mitaka release
Hi Boris,
Thank you for your prompt response.
As a matter of clarification, I did not manage the key pairs in web interface or through
command line.
It launches the instance without any key pair. Also I am not trying to login into VM’s
floating-ip via ssh.
I am trying to access an Instance Console using the Dashboard.
Option 1.
[BD] Then you may to start VM with "--user-data" :-
[root@dfw02 ~(keystone_admin)]$ nova boot --flavor 2 --user-data=./myfile.txt
--image 03c9ad20-b0a3-4b71-aa08-2728ecb66210 VF20Devs
where
[root@dfw02 ~(keystone_admin)]$ cat ./myfile.txt
#cloud-config
password: mysecret
chpasswd: { expire: False }
ssh_pwauth: True
This way will allow you login via ssh and dashboard with password "secret"
No ssh keypairs are supposed to be created
It shows me the login prompt. But I am not able to log in to the instance’s console
(Dashboard) using username (root) and password (root). it says “Log in incorrect”.
Option 2.
[BD] Please, read and follow ( I am sending this to you second time )
1) create key-pair via nova CLI or dashboard
2) Launch instance dialog is providing an entry line "Key pair" . Place oskey01
there ( click on "+" in Mitaka )
Thus it would write RSA public key to ~fedora/.ssh/authorized_keys on VM's file
system ( when you boot VM the first time )
3) oskey01.pem would be located in folder where you ran `nova keypair-add oske01 >
oskey01.pem`
Content of pem file is RSA private key from keypair generated by nova CLI
4) Login to VM via SSH :-
ssh -i oskey01.pem fedora@VM's floating-ip ( no password needed )
Then inside VM :-
$ sudo su -
no password required fedora is a special user setup via cloud-init
As root assign password to fedora and root ( for instance )
Switch to dashboard and log into VNC console to VM . Created password are persistent for
VM
Regards,
Chinmaya
On Fri, May 27, 2016 at 2:50 PM, Boris Derzhavets
<bderzhavets@hotmail.com<mailto:bderzhavets@hotmail.com>> wrote:
Then as fedora user inside VM :-
$ sudo su -
# passwd fedora
You will get login prompt for fedora via dashboard console
in the same session ( or for root, it doesn't matter )
________________________________
From: rdo-list-bounces@redhat.com<mailto:rdo-list-bounces@redhat.com>
<rdo-list-bounces@redhat.com<mailto:rdo-list-bounces@redhat.com>> on behalf of
Boris Derzhavets <bderzhavets@hotmail.com<mailto:bderzhavets@hotmail.com>>
Sent: Friday, May 27, 2016 2:50 AM
To: Chinmaya Dwibedy; rdo-list@redhat.com<mailto:rdo-list@redhat.com>
Subject: Re: [rdo-list] Unable to log in to the VM instance’s console using
openstack-mitaka release
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
Boris.
________________________________
From: rdo-list-bounces@redhat.com<mailto:rdo-list-bounces@redhat.com>
<rdo-list-bounces@redhat.com<mailto:rdo-list-bounces@redhat.com>> on behalf of
Chinmaya Dwibedy <ckdwibedy@gmail.com<mailto:ckdwibedy@gmail.com>>
Sent: Friday, May 27, 2016 2:24 AM
To: rdo-list@redhat.com<mailto:rdo-list@redhat.com>
Subject: [rdo-list] Unable to log in to the VM instance’s console using openstack-mitaka
release
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