Openstack Trial And Error after having done part 2: continue following Mirantis Howto, which is a bit old (but it still works), so we have some notes written here and there.
To set up Ubuntu server, we need last image file. Because newest Openstack supports only manual uploading of the img file, we need to find one. For the time writing, the newest daily build
IMG file is of Artful Aardvark. I chose artful-server-cloudimg-amd64.img (305MB)
After your slow internet does its job, we move on:
Log in to web interface
Compute -> Images -> Create image
Image Name: Ubuntu_Artful_x64_Server
Source type: File
File: Browse -> our IMG file
Format: QCOW2 - QUEMU emulator
Create image
We wait for IMG to be uploaded to server… After it’s build, we can press Launch.
Compute -> Images
Ubuntu_Artful_x64_Server
-> Launch
Details:
Instance Name: basicUbSrv
Source -> Create Volume -> No (We’re booting from image, but we could also have a volume by side.)
Flavor: ds512M
(quite good flavor)
Network: basicNetwork
SSH RSA pair
Ubuntu cloud images do not have username and password predefined. (Wikipedia be like: “Citation needed”) To log in, we use SSH RSA pair:
tab keyPair:
Create Key Pair -> name: basicUbSrvKey
-> Create
copy key to a file - for example basicUbSrvKey.pem
somewhere on your local HDD.
click Done, Launch Instance.
Compute -> Instances
We wait a bit so our BasicUbSrv loads up into working instance, and see if it runs:
tab Log-> View Full Log (in new browser tab)
Here we monitor how is our machine booting (manually refresh webpage) - it took me about 5mins.
In the end we can notice the SSH keys for ubuntu user:
Ubuntu 17.10 basicubsrv ttyS0
basicubsrv login: [ 304.812499] cloud-init[716]: Cloud-init v. 17.1 running 'modules:config' at Fri, 22 Dec 2017 22:50:23 +0000. Up 276.32 seconds.
ci-info: ++++++++++Authorized keys from /home/ubuntu/.ssh/authorized_keys for user ubuntu+++++++++++
ci-info: +---------+-------------------------------------------------+---------+-------------------+
ci-info: | Keytype | Fingerprint (md5) | Options | Comment |
ci-info: +---------+-------------------------------------------------+---------+-------------------+
ci-info: | ssh-rsa | | - | Generated-by-Nova |
ci-info: +---------+-------------------------------------------------+---------+-------------------+
<14>Dec 22 22:51:14 ec2:
<14>Dec 22 22:51:14 ec2: #############################################################
<14>Dec 22 22:51:14 ec2: -----BEGIN SSH HOST KEY FINGERPRINTS-----
<14>Dec 22 22:51:14 ec2: 1024 SHA256:................................ root@basicubsrv (DSA)
<14>Dec 22 22:51:14 ec2: 256 SHA256:................................. root@basicubsrv (ECDSA)
<14>Dec 22 22:51:14 ec2: 256 SHA256:................................. root@basicubsrv (ED25519)
<14>Dec 22 22:51:14 ec2: SHA256:........................................ root@basicubsrv (RSA)
<14>Dec 22 22:51:14 ec2: -----END SSH HOST KEY FINGERPRINTS-----
<14>Dec 22 22:51:14 ec2: #############################################################
-----BEGIN SSH HOST KEY KEYS-----
ecdsa-sha2-nistp256 ...... root@basicubsrv
ssh-ed25519 ... ... ... root@basicubsrv
ssh-rsa ... root@basicubsrv
-----END SSH HOST KEY KEYS-----
[ 327.967390] cloud-init[852]: Cloud-init v. 17.1 running 'modules:final' at Fri, 22 Dec 2017 22:51:05 +0000. Up 318.24 seconds.
[ 327.985083] cloud-init[852]: Cloud-init v. 17.1 finished at Fri, 22 Dec 2017 22:51:15 +0000. Datasource DataSourceOpenStack [net,ver=2]. Up 327.73 seconds
We use RSA to log in the machin–….
Where exacly are we connecting to?
Anybody remembers “Floating IP”?
Project -> Compute -> Instances:
basicUbSrv -> associate Floating IP -> choose that floating IP and send it straight to the port.
Now, for real:
server@ubsrv:~$ ping 172.24.4.8
PING 172.24.4.8 (172.24.4.8) 56(84) bytes of data.
64 bytes from 172.24.4.8: icmp_seq=1 ttl=63 time=2.63 ms
64 bytes from 172.24.4.8: icmp_seq=2 ttl=63 time=0.622 ms
Host machine - check! Wind(bl)ows 10: open cmd as admin, run:
route add 172.24.4.0 mask 255.255.255.0 192.168.31.141 metric 3
172.24.4.0
being our floating IP pool, 192.168.31.141
being our OpenStack server.
Great, we run PuTTY Key Generator (PuTTYGen), File, Load, use the file basicUbSrvKey.pem
, open it, save private key as basicUbSrvKey.ppk.
open PuTTY, type floating IP address, then under left side, Connections->SSH->Auth find button Browse, and point it to basicUbSrvKey.ppk
.
Connect and log in as ubuntu
.
sudo su
passwd ubuntu
…and choose your new password for sudo operations…
Enough for today.