Set up Two Node RDO Juno ML2&OVS&VXLAN Cluster runnig Docker Hypervisor on Compute Node (CentOS 7, kernel 3.10.0-123.20.1.el7.x86_64)

February 6, 2015

It’s quite obvious that Nova-Docker driver set up success for real application is important to get on Compute Nodes . It’s nice when everything works on AIO Juno host or Controller, but  just as demonstration. Might be I did something wrong , might be due to some other reason but kernel version 3.10.0-123.20.1.el7.x86_64 seems to be the first brings  success on RDO Juno Compute nodes.

Follow http://lxer.com/module/newswire/view/209851/index.html  up to section

“Set up Nova-Docker on Controller&&Network Node”

***************************************************
Set up  Nova-Docker Driver on Compute Node
***************************************************

# yum install python-pbr
# yum install docker-io -y
# git clone https://github.com/stackforge/nova-docker
# cd nova-docker
# git checkout stable/juno
# python setup.py install
# systemctl start docker
# systemctl enable docker
# chmod 660  /var/run/docker.sock
#  mkdir /etc/nova/rootwrap.d

************************************************
Create the docker.filters file:
************************************************

vi /etc/nova/rootwrap.d/docker.filters

Insert Lines

# nova-rootwrap command filters for setting up network in the docker driver
# This file should be owned by (and only-writeable by) the root user
[Filters]
# nova/virt/docker/driver.py: ‘ln’, ‘-sf’, ‘/var/run/netns/.*’
ln: CommandFilter, /bin/ln, root

*****************************************
Add line /etc/glance/glance-api.conf
*****************************************
container_formats=ami,ari,aki,bare,ovf,ova,docker
:wq

******************************
Update nova.conf
******************************

vi /etc/nova/nova.conf

set “compute_driver = novadocker.virt.docker.DockerDriver”

************************
Restart Services
************************

usermod -G docker nova

systemctl restart openstack-nova-compute (on Compute)
systemctl status openstack-nova-compute
systemctl restart openstack-glance-api (on Controller&&Network )

At this point `scp  /root/keystonerc_admin compute:/root`  from Controller to Compute Node

*************************************************************
Test installation Nova-Docker Driver on Compute Node (RDO Juno , CentOS 7,kernel 3.10.0-123.20.1.el7.x86_64 )
**************************************************************

*******************************************

Setup Ubuntu 14.04 with SSH access

*******************************************

First on Compute node

# docker pull rastasheep/ubuntu-sshd:14.04

# . keystonerc_admin

# docker save rastasheep/ubuntu-sshd:14.04 | glance image-create –is-public=True   –container-format=docker –disk-format=raw –name rastasheep/ubuntu-sshd:14.04

Second on Controller node launch Nova-Docker container , running on Compute via dashboard and assign floating IP address

Pic15          Pic16

 

*********************************************
Verify `docker ps ` on Compute Node
*********************************************

[root@juno1dev ~]# ssh 192.168.1.137

Last login: Fri Feb  6 15:38:49 2015 from juno1dev.localdomain

[root@juno2dev ~]# docker ps

CONTAINER ID        IMAGE                          COMMAND               CREATED             STATUS              PORTS               NAMES

ef23d030e35a        rastasheep/ubuntu-sshd:14.04   “/usr/sbin/sshd -D”   7 hours ago         Up 6 minutes                            nova-211bcb54-35ba-4f0a-a150-7e73546d8f46

[root@juno2dev ~]# ip netns

ef23d030e35af63c17698d1f4c6f7d8023c29455e9dff0288ce224657828993a
ca9aa6cb527f2302985817d3410a99c6f406f4820ed6d3f62485781d50f16590
fea73a69337334b36625e78f9a124e19bf956c73b34453f1994575b667e7401b
58834d3bbea1bffa368724527199d73d0d6fde74fa5d24de9cca41c29f978e31
********************************
On Controller run :-
********************************

[root@juno1dev ~]# ssh root@192.168.1.173
root@192.168.1.173’s password:
Last login: Fri Feb  6 12:11:19 2015 from 192.168.1.127

root@instance-0000002b:~# apt-get update

Ign http://archive.ubuntu.com trusty InRelease
Ign http://archive.ubuntu.com trusty-updates InRelease
Ign http://archive.ubuntu.com trusty-security InRelease
Hit http://archive.ubuntu.com trusty Release.gpg
Get:1 http://archive.ubuntu.com trusty-updates Release.gpg [933 B]
Get:2 http://archive.ubuntu.com trusty-security Release.gpg [933 B]
Hit http://archive.ubuntu.com trusty Release
Get:3 http://archive.ubuntu.com trusty-updates Release [62.0 kB]
Get:4 http://archive.ubuntu.com trusty-security Release [62.0 kB]
Hit http://archive.ubuntu.com trusty/main Sources
Hit http://archive.ubuntu.com trusty/restricted Sources
Hit http://archive.ubuntu.com trusty/universe Sources
Hit http://archive.ubuntu.com trusty/main amd64 Packages
Hit http://archive.ubuntu.com trusty/restricted amd64 Packages
Hit http://archive.ubuntu.com trusty/universe amd64 Packages
Get:5 http://archive.ubuntu.com trusty-updates/main Sources [208 kB]
Get:6 http://archive.ubuntu.com trusty-updates/restricted Sources [1874 B]
Get:7 http://archive.ubuntu.com trusty-updates/universe Sources [124 kB]
Get:8 http://archive.ubuntu.com trusty-updates/main amd64 Packages [524 kB]
Get:9 http://archive.ubuntu.com trusty-updates/restricted amd64 Packages [14.8 kB]
Get:10 http://archive.ubuntu.com trusty-updates/universe amd64 Packages [318 kB]
Get:11 http://archive.ubuntu.com trusty-security/main Sources [79.8 kB]
Get:12 http://archive.ubuntu.com trusty-security/restricted Sources [1874 B]
Get:13 http://archive.ubuntu.com trusty-security/universe Sources [19.1 kB]
Get:14 http://archive.ubuntu.com trusty-security/main amd64 Packages [251 kB]
Get:15 http://archive.ubuntu.com trusty-security/restricted amd64 Packages [14.8 kB]
Get:16 http://archive.ubuntu.com trusty-security/universe amd64 Packages [110 kB]
Fetched 1793 kB in 9s (199 kB/s)
Reading package lists… Done

If network operations like `apt-get install … ` run afterwards with no problems

Nova-Docker driver is installed  and works on Compute Node

**************************************************************************************
Finally I’ve set up openstack-nova-compute on Controller ,  to run several instances with  Qemu/Libvirt driver :-
**************************************************************************************

Pic17          Pic18

Advertisements

Set up Nova-Docker on OpenStack RDO Juno on top of Fedora 21

January 11, 2015
****************************************************************************************
UPDATE as of 01/31/2015 to get Docker && Nova-Docker working on Fedora 21
****************************************************************************************
Per https://github.com/docker/docker/issues/10280
download systemd-218-3.fc22.src.rpm && build 218-3 rpms and upgrade systemd
First packages for rpmbuild :-

$ sudo yum install audit-libs-devel autoconf  automake cryptsetup-devel \
dbus-devel docbook-style-xsl elfutils-devel  \
glib2-devel  gnutls-devel  gobject-introspection-devel \
gperf     gtk-doc intltool kmod-devel libacl-devel \
libblkid-devel     libcap-devel libcurl-devel libgcrypt-devel \
libidn-devel libmicrohttpd-devel libmount-devel libseccomp-devel \
libselinux-devel libtool pam-devel python3-devel python3-lxml \
qrencode-devel  python2-devel  xz-devel

Second:-
$cd rpmbuild/SPEC
$rpmbuild -bb systemd.spec
$ cd ../RPMS/x86_64
Third:-

$ sudo yum install libgudev1-218-3.fc21.x86_64.rpm \
libgudev1-devel-218-3.fc21.x86_64.rpm \
systemd-218-3.fc21.x86_64.rpm \
systemd-compat-libs-218-3.fc21.x86_64.rpm \
systemd-debuginfo-218-3.fc21.x86_64.rpm \
systemd-devel-218-3.fc21.x86_64.rpm \
systemd-journal-gateway-218-3.fc21.x86_64.rpm \
systemd-libs-218-3.fc21.x86_64.rpm \
systemd-python-218-3.fc21.x86_64.rpm \
systemd-python3-218-3.fc21.x86_64.rpm

****************************************************************************************

Recently Filip Krikava made a fork on github and created a Juno branch using

the latest commitFix the problem when an image is not located in the local docker image registry

Master https://github.com/stackforge/nova-docker.git is targeting latest Nova ( Kilo release ), forked branch is supposed to work for Juno , reasonably including commits after “Merge oslo.i18n”. Posting bellow is supposed to test Juno Branch https://github.com/fikovnik/nova-docker.git

Quote ([2]) :-

The Docker driver is a hypervisor driver for Openstack Nova Compute. It was introduced with the Havana release, but lives out-of-tree for Icehouse and Juno. Being out-of-tree has allowed the driver to reach maturity and feature-parity faster than would be possible should it have remained in-tree. It is expected the driver will return to mainline Nova in the Kilo release.

Install required packages to install nova-docker driver per https://wiki.openstack.org/wiki/Docker

***************************
Initial docker setup
***************************

# yum install docker-io -y
# yum install -y python-pip git
# git clone https://github.com/fikovnik/nova-docker.git
# cd nova-docker
# git branch -v -a

master                1ed1820 A note no firewall drivers.
remotes/origin/HEAD   -> origin/master
remotes/origin/juno   1a08ea5 Fix the problem when an image
is not located in the local docker image registry.
remotes/origin/master 1ed1820 A note no firewall drivers.
# git checkout -b juno origin/juno
# python setup.py install
# systemctl start docker
# systemctl enable docker
# chmod 660  /var/run/docker.sock
# pip install pbr
#  mkdir /etc/nova/rootwrap.d

******************************
Update nova.conf
******************************

vi /etc/nova/nova.conf

set “compute_driver = novadocker.virt.docker.DockerDriver”

************************************************
Next, create the docker.filters file:
************************************************

vi /etc/nova/rootwrap.d/docker.filters

Insert Lines
# nova-rootwrap command filters for setting up network in the docker driver
# This file should be owned by (and only-writeable by) the root user
[Filters]
# nova/virt/docker/driver.py: ‘ln’, ‘-sf’, ‘/var/run/netns/.*’
ln: CommandFilter, /bin/ln, root

*****************************************
Add line /etc/glance/glance-api.conf
*****************************************

container_formats=ami,ari,aki,bare,ovf,ova,docker

:wq

************************
Restart Services
************************

usermod -G docker nova

systemctl restart openstack-nova-compute
systemctl status openstack-nova-compute
systemctl restart openstack-glance-api

*******************************************************************************
Verification nova-docker driver  been  built on Fedora 21

*******************************************************************************
Build bellow is extending  phusion/baseimage to start several daemons at a time during launching nova-docker container. It has been tested on Nova-Docker RDO Juno on top of CentOS 7 ( view Set up GlassFish 4.1 Nova-Docker Container via phusion/baseimage on RDO Juno ). Here it is reproduced on Nova-Docker RDO Juno on top of Fedora 21 coming afterwards `packstack –allinone` Juno installation on Fedora 21,  been run pretty smoothly .

 FROM phusion/baseimage

MAINTAINER Boris Derzhavets

RUN apt-get update
RUN echo ‘root:root’ |chpasswd
RUN sed -ri ‘s/^PermitRootLogin\s+.*/PermitRootLogin yes/’ /etc/ssh/sshd_config
RUN sed -ri ‘s/UsePAM yes/#UsePAM yes/g’ /etc/ssh/sshd_config
##################################################
# Hack to avoid external start SSH session inside container,
# otherwise sshd won’t start when docker container loads
##################################################
RUN echo “/usr/sbin/sshd > log & ” >>  /etc/my_init.d/00_regen_ssh_host_keys.sh

RUN apt-get update && apt-get install -y wget
RUN wget –no-check-certificate –no-cookies –header “Cookie: oraclelicense=accept-securebackup-cookie” http://download.oracle.com/otn-pub/java/jdk/8u25-b17/jdk-8u25-linux-x64.tar.gz
RUN cp  jdk-8u25-linux-x64.tar.gz /opt
RUN cd /opt; tar -zxvf jdk-8u25-linux-x64.tar.gz
ENV PATH /opt/jdk1.8.0_25/bin:$PATH

RUN apt-get update &&  \
apt-get install -y wget unzip pwgen expect net-tools vim &&  \
wget http://download.java.net/glassfish/4.1/release/glassfish-4.1.zip &&  \
unzip glassfish-4.1.zip -d /opt &&  \
rm glassfish-4.1.zip &&  \
apt-get clean &&  \
rm -rf /var/lib/apt/lists/*
ENV PATH /opt/glassfish4/bin:$PATH

ADD run.sh /etc/my_init.d/
ADD database.sh  /etc/my_init.d/

ADD change_admin_password.sh /change_admin_password.sh
ADD change_admin_password_func.sh /change_admin_password_func.sh
ADD enable_secure_admin.sh /enable_secure_admin.sh
RUN chmod +x /*.sh /etc/my_init.d/*.sh

# 4848 (administration), 8080 (HTTP listener), 8181 (HTTPS listener), 9009 (JPDA debug port)

EXPOSE 22  4848 8080 8181 9009

CMD [“/sbin/my_init”]

***************************************************************
Another option not to touch 00_regen_ssh_host_keys.sh
***************************************************************
# RUN echo “/usr/sbin/sshd > log & ” >>  /etc/my_init.d/00_regen_ssh_host_keys.sh

***************************************************************
Create in building folder script  01_sshd_start.sh
***************************************************************

#!/bin/bash
/usr/sbin/sshd > log &
and insert in Dockerfile:-
ADD 01_sshd_start.sh /etc/my_init.d/

********************************************************************************
I had to update database.sh script as follows to make nova-docker container
starting  on RDO Juno on top of Fedora 21 ( view http://lxer.com/module/newswire/view/209277/index.html ).
********************************************************************************

# cat database.sh

#!/bin/bash
set -e
asadmin start-database –dbhost 127.0.0.1 –terse=true >  log &;

the important  change is binding dbhost to 127.0.0.1 , which  is not required for loading docker container. Nova-Docker Driver ( http://www.linux.com/community/blogs/133-general-linux/799569-running-nova-docker-on-openstack-rdo-juno-centos-7 ) seems to be more picky about –dbhost  key value of Derby Database

*********************
Build image
*********************

[root@junolxc docker-glassfish41]# ls -l

total 44
-rw-r–r–. 1 root root   217 Jan  7 00:27 change_admin_password_func.sh
-rw-r–r–. 1 root root   833 Jan  7 00:27 change_admin_password.sh
-rw-r–r–. 1 root root   473 Jan  7 00:27 circle.yml
-rw-r–r–. 1 root root    44 Jan  7 00:27 database.sh
-rw-r–r–. 1 root root  1287 Jan  7 00:27 Dockerfile
-rw-r–r–. 1 root root   167 Jan  7 00:27 enable_secure_admin.sh
-rw-r–r–. 1 root root 11323 Jan  7 00:27 LICENSE
-rw-r–r–. 1 root root  2123 Jan  7 00:27 README.md
-rw-r–r–. 1 root root   354 Jan  7 00:27 run.sh
[root@junolxc docker-glassfish41]# docker build -t derby/docker-glassfish41 .

******************************************
RDO (AIO install)  Juno status on Fedora 21
*******************************************

[root@fedora21 ~(keystone_admin)]# openstack-status
== Nova services ==
openstack-nova-api:                     active
openstack-nova-cert:                    active
openstack-nova-compute:                 active
openstack-nova-network:                 inactive  (disabled on boot)
openstack-nova-scheduler:               active
openstack-nova-conductor:               active
== Glance services ==
openstack-glance-api:                   active
openstack-glance-registry:              active
== Keystone service ==
openstack-keystone:                     active
== Horizon service ==
openstack-dashboard:                    active
== neutron services ==
neutron-server:                         active
neutron-dhcp-agent:                     active
neutron-l3-agent:                       active
neutron-metadata-agent:                 active
neutron-lbaas-agent:                    inactive  (disabled on boot)
neutron-openvswitch-agent:              active
== Swift services ==
openstack-swift-proxy:                  active
openstack-swift-account:                active
openstack-swift-container:              active
openstack-swift-object:                 active
== Cinder services ==
openstack-cinder-api:                   active
openstack-cinder-scheduler:             active
openstack-cinder-volume:                active
openstack-cinder-backup:                active
== Ceilometer services ==
openstack-ceilometer-api:               active
openstack-ceilometer-central:           active
openstack-ceilometer-compute:           active
openstack-ceilometer-collector:         active
openstack-ceilometer-alarm-notifier:    active
openstack-ceilometer-alarm-evaluator:   active
openstack-ceilometer-notification:      active
== Support services ==
libvirtd:                               active
openvswitch:                            active
dbus:                                   active
target:                                 inactive  (disabled on boot)
rabbitmq-server:                        active
memcached:                              active
== Keystone users ==
+———————————-+————+———+———————-+
|                id                |    name    | enabled |        email         |
+———————————-+————+———+———————-+
| edfb1cd3c4d54401ac810b14e8d953f2 |   admin    |   True  |    root@localhost    |
| 783df7494254423aaed3bfe0cc2262af | ceilometer |   True  | ceilometer@localhost |
| 955e7619fc6749f68843030d9da6cef3 |   cinder   |   True  |   cinder@localhost   |
| 1ed0f9f7705341b79f58190ea31160fc |    demo    |   True  |                      |
| 68362c2c7ad642ab9ea31164cad35268 |   glance   |   True  |   glance@localhost   |
| b7dec54d6b984c16afca2935cc09c478 |  neutron   |   True  |  neutron@localhost   |
| c35cad56c0e548aaa6907e0da3eca569 |    nova    |   True  |    nova@localhost    |
| a959def1f10e48d6959a70bc930e8522 |   swift    |   True  |   swift@localhost    |
+———————————-+————+———+———————-+
== Glance images ==
+————————————–+———————————+————-+——————+————+——–+
| ID                                   | Name                            | Disk Format | Container Format | Size       | Status |
+————————————–+———————————+————-+——————+————+——–+
| 08b235e5-7f2b-4bc4-959e-582482037019 | cirros                          | qcow2       | bare             | 13200896   | active |
| fcb9a93a-6a28-413f-853b-4ad362aed0c5 | derby/docker-glassfish41:latest | raw         | docker           | 1112110592 | active |
| 032952ba-5bb3-41cc-9a2a-d4c76d197571 | dba07/docker-glassfish41:latest | raw         | docker           | 1112110592 | active |
| ce0adab4-3f09-45cc-81fa-cd8cc6acc7c1 | rastasheep/ubuntu-sshd:14.04    | raw         | docker           | 263785472  | active |
| 230040b3-c5d1-4bf0-b5e4-9f112fd71c70 | Ubuntu14.04-011014              | qcow2       | bare             | 256311808  | active |
+————————————–+———————————+————-+——————+————+——–+
== Nova managed services ==
+—-+——————+———————-+———-+———+——-+—————————-+—————–+
| Id | Binary           | Host                 | Zone     | Status  | State | Updated_at                 | Disabled Reason |
+—-+——————+———————-+———-+———+——-+—————————-+—————–+
| 1  | nova-consoleauth | fedora21.localdomain | internal | enabled | up    | 2015-01-11T09:45:21.000000 | –               |
| 2  | nova-scheduler   | fedora21.localdomain | internal | enabled | up    | 2015-01-11T09:45:22.000000 | –               |
| 3  | nova-conductor   | fedora21.localdomain | internal | enabled | up    | 2015-01-11T09:45:22.000000 | –               |
| 5  | nova-compute     | fedora21.localdomain | nova     | enabled | up    | 2015-01-11T09:45:20.000000 | –               |
| 6  | nova-cert        | fedora21.localdomain | internal | enabled | up    | 2015-01-11T09:45:29.000000 | –               |
+—-+——————+———————-+———-+———+——-+—————————-+—————–+
== Nova networks ==
+————————————–+————–+——+
| ID                                   | Label        | Cidr |
+————————————–+————–+——+
| 046e1e6f-b09c-4daf-9732-3ed0b6e5fdf8 | public       | –    |
| 76709a1a-61e7-4488-9ecf-96dbd88d4fb6 | private      | –    |
| 7b2c1d87-cea1-40aa-a1d7-dbac3cc99798 | demo_network | –    |
+————————————–+————–+——+
== Nova instance flavors ==
+—-+———–+———–+——+———–+——+——-+————-+———–+
| ID | Name      | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
+—-+———–+———–+——+———–+——+——-+————-+———–+
| 1  | m1.tiny   | 512       | 1    | 0         |      | 1     | 1.0         | True      |
| 2  | m1.small  | 2048      | 20   | 0         |      | 1     | 1.0         | True      |
| 3  | m1.medium | 4096      | 40   | 0         |      | 2     | 1.0         | True      |
| 4  | m1.large  | 8192      | 80   | 0         |      | 4     | 1.0         | True      |
| 5  | m1.xlarge | 16384     | 160  | 0         |      | 8     | 1.0         | True      |
+—-+———–+———–+——+———–+——+——-+————-+———–+
== Nova instances ==
+—-+——+——–+————+————-+———-+
| ID | Name | Status | Task State | Power State | Networks |
+—-+——+——–+————+————-+———-+
+—-+——+——–+————+————-+———-+

*************************
Upload image to glance
*************************

# . keystonerc_admin

# docker save derby/docker-glassfish41:latest | glance image-create –is-public=True   –container-format=docker –disk-format=raw –name derby/docker-glassfish41:latest

**********************
Launch instance
**********************
# .  keystonerc_demo

# nova boot –image “derby/docker-glassfish41:latest” –flavor m1.small –key-name  oskey57    –nic net-id=demo_network-id DerbyGlassfish41

Derby1F21

Derby2F21

Derby3F21

Derby5F21


Running Nova-Docker on OpenStack Juno (CentOS 7)

December 16, 2014

Recently Filip Krikava made a fork on github and created a Juno branch using the latest commit +Fix the problem when an image is not located in the local docker image registry ( https://github.com/fikovnik/nova-docker/commit/016cc98e2f8950ae3bf5e27912be20c52fc9e40e )
Master https://github.com/stackforge/nova-docker.git is targeting latest Nova ( Kilo release ), forked branch is supposed to work for Juno , reasonably including commits after “Merge oslo.i18n”. Posting bellow is supposed to test Juno Branch https://github.com/fikovnik/nova-docker.git

Quote ([2]) :-

The Docker driver is a hypervisor driver for Openstack Nova Compute. It was introduced with the Havana release, but lives out-of-tree for Icehouse and Juno. Being out-of-tree has allowed the driver to reach maturity and feature-parity faster than would be possible should it have remained in-tree. It is expected the driver will return to mainline Nova in the Kilo release.

This post in general follows up ([2]) with detailed instructions of nova-docker

driver install on RDO Juno (CentOS 7) ([3]).

Install required packages to install nova-dockker driver per https://wiki.openstack.org/wiki/Docker

***************************

Initial docker setup

***************************

# yum install docker-io -y
# yum install -y python-pip git
# git clone https://github.com/fikovnik/nova-docker.git
# cd nova-docker
# git branch -v -a

#  master                1ed1820 A note no firewall drivers.
remotes/origin/HEAD   -> origin/master
remotes/origin/juno   1a08ea5 Fix the problem when an image
is not located in the local docker image registry.
remotes/origin/master 1ed1820 A note no firewall drivers.
# git checkout -b juno origin/juno
# python setup.py install
# systemctl start docker
# systemctl enable docker
# chmod 660  /var/run/docker.sock
# pip install pbr
#  mkdir /etc/nova/rootwrap.d

******************************

Update nova.conf

******************************

vi /etc/nova/nova.conf

set “compute_driver = novadocker.virt.docker.DockerDriver”

************************************************

Next, create the docker.filters file:

************************************************

vi /etc/nova/rootwrap.d/docker.filters

Insert Lines

# nova-rootwrap command filters for setting up network in the docker driver

# This file should be owned by (and only-writeable by) the root user

[Filters]

# nova/virt/docker/driver.py: ‘ln’, ‘-sf’, ‘/var/run/netns/.*’

ln: CommandFilter, /bin/ln, root

*****************************************

Add line /etc/glance/glance-api.conf

*****************************************

container_formats=ami,ari,aki,bare,ovf,ova,docker

:wq

************************

Restart Services

************************

usermod -G docker nova

systemctl restart openstack-nova-compute

systemctl status openstack-nova-compute

systemctl restart openstack-glance-api

******************************

Verification docker install

******************************

[root@juno ~]# docker run -i -t fedora /bin/bash

Unable to find image ‘fedora’ locally

fedora:latest: The image you are pulling has been verified

00a0c78eeb6d: Pull complete

2f6ab0c1646e: Pull complete

511136ea3c5a: Already exists

Status: Downloaded newer image for fedora:latest

bash-4.3# cat /etc/issue

Fedora release 21 (Twenty One)

Kernel \r on an \m (\l)

[root@juno ~]# docker ps -a

CONTAINER ID        IMAGE                    COMMAND             CREATED             STATUS                        PORTS               NAMES

738e54f9efd4        fedora:latest            “/bin/bash”         3 minutes ago       Exited (127) 25 seconds ago                       stoic_lumiere

14fd0cbba76d        ubuntu:latest            “/bin/bash”         3 minutes ago       Exited (0) 3 minutes ago                          prickly_hypatia

ef1a726d1cd4        fedora:latest            “/bin/bash”         5 minutes ago       Exited (0) 3 minutes ago                          drunk_shockley

0a2da90a269f        ubuntu:latest            “/bin/bash”         11 hours ago        Exited (0) 11 hours ago                           thirsty_kowalevski

5a3288ce0e8e        ubuntu:latest            “/bin/bash”         11 hours ago        Exited (0) 11 hours ago                           happy_leakey

21e84951eabd        tutum/wordpress:latest   “/run.sh”           16 hours ago        Up About an hour                                  nova-bf5f7eb9-900d-48bf-a230-275d65813b0f

*******************

Setup WordPress

*******************

# docker pull tutum/wordpress

# . keystonerc_admin

# docker save tutum/wordpress | glance image-create --is-public=True --container-format=docker --disk-format=raw --name tutum/wordpress



[root@juno ~(keystone_admin)]# glance image-list
+--------------------------------------+-----------------+-------------+------------------+-----------+--------+
| ID                                   | Name            | Disk Format | Container Format | Size      | Status |
+--------------------------------------+-----------------+-------------+------------------+-----------+--------+
| c6d01e60-56c2-443f-bf87-15a0372bc2d9 | cirros          | qcow2       | bare             | 13200896  | active |
| 9d59e7ad-35b4-4c3f-9103-68f85916f36e | tutum/wordpress | raw         | docker           | 517639680 | active |
+--------------------------------------+-----------------+-------------+------------------+-----------+--------+

********************

Start container

********************

$ . keystonerc_demo

[root@juno ~(keystone_demo)]# neutron net-list

+————————————–+————–+——————————————————-+

| id                                   | name         | subnets                                               |

+————————————–+————–+——————————————————-+

| ccfc4bb1-696d-4381-91d7-28ce7c9cb009 | private      | 6c0a34ab-e3f1-458c-b24a-96f5a2149878 10.0.0.0/24      |

| 32c14896-8d47-4a56-b3c6-0dd823f03089 | public       | b1799aef-3f69-429c-9881-f81c74d83060 192.169.142.0/24 |

| a65bff8f-e397-491b-aa97-955864bec2f9 | demo_private | 69012862-f72e-4cd2-a4fc-4106d431cf2f 70.0.0.0/24      |

+————————————–+————–+——————————————————-+

$ nova boot –image “tutum/wordpress” –flavor m1.tiny –key-name  osxkey –nic net-id=a65bff8f-e397-491b-aa97-955864bec2f9 WordPress

[root@juno ~(keystone_demo)]# nova list

+————————————–+———–+———+————+————-+—————————————–+

| ID                                   | Name      | Status  | Task State | Power State | Networks                                |

+————————————–+———–+———+————+————-+—————————————–+

| bf5f7eb9-900d-48bf-a230-275d65813b0f |  WordPress   | ACTIVE  | –          | Running     | demo_private=70.0.0.16, 192.169.142.153 |

+—————————-———-+———–+———+————+————-+—————————————–+

[root@juno ~(keystone_demo)]# docker ps -a

CONTAINER ID        IMAGE                    COMMAND             CREATED             STATUS                   PORTS               NAMES

21e84951eabd        tutum/wordpress:latest   “/run.sh”           About an hour ago   Up 11 minutes                                nova-bf5f7eb9-900d-48bf-a230-275d65813b0f

**************************

Starting WordPress

**************************

Immediately after VM starts (on non-default Libvirts Subnet 192.169.142.0/24) status WordPress  is SHUTOFF, so we start WordPress (browser launched to

Juno VM 192.169.142.45 from KVM Hypervisor Server ) :-

   Browser launched to WordPress container 192.169.142.153  from KVM  Hypervisor Server

 

 **********************************************************************************

Floating IP assigned to WordPress container  been used to launch browser:-

**********************************************************************************

*******************************************************************************************

Another sample to demonstrating nova-docker container functionality. Browser launched to WordPress nova-docker container   (192.169.142.155)   from KVM Hypervisor Server hosting Libvirt’s Subnet (192.169.142.0/24)

*******************************************************************************************

 

*****************

MySQL Setup

*****************

  # docker pull tutum/mysql

  # .   keystonerc_admin

*****************************

Creating Glance Image

*****************************

#   docker save tutum/mysql:latest | glance image-create –is-public=True –container-format=docker –disk-format=raw –name tutum/mysql:latest

****************************************

Starting Nova-Docker container

****************************************

# .   keystonerc_demo

#   nova boot –image “tutum/mysql:latest” –flavor m1.tiny –key-name  osxkey –nic net-id=5fcd01ac-bc8e-450d-be67-f0c274edd041 mysql

 

 [root@ip-192-169-142-45 ~(keystone_demo)]# nova list

+————————————–+—————+——–+————+————-+—————————————–+

| ID                                   | Name          | Status | Task State | Power State | Networks                                |

+————————————–+—————+——–+————+————-+—————————————–+

| 3dbf981f-f28c-4abe-8fd1-09b8b8cad930 | WordPress     | ACTIVE | –          | Running     | demo_network=70.0.0.16, 192.169.142.153 |

| 39eef361-1329-44d9-b05a-f6b4b8693aa3 | mysql         | ACTIVE | –          | Running     | demo_network=70.0.0.19, 192.169.142.155 |

| 626bd8e0-cf1a-4891-aafc-620c464e8a94 | tutum/hipache | ACTIVE | –          | Running     | demo_network=70.0.0.18, 192.169.142.154 |

+————————————–+—————+——–+————+————-+—————————————–+

[root@ip-192-169-142-45 ~(keystone_demo)]# docker ps -a

CONTAINER ID        IMAGE                          COMMAND               CREATED             STATUS                         PORTS               NAMES

3da1e94892aa        tutum/mysql:latest             “/run.sh”             25 seconds ago      Up 23 seconds                                      nova-39eef361-1329-44d9-b05a-f6b4b8693aa3

77538873a273        tutum/hipache:latest           “/run.sh”             30 minutes ago                                                         condescending_leakey

844c75ca5a0e        tutum/hipache:latest           “/run.sh”             31 minutes ago                                                         condescending_turing

f477605840d0        tutum/hipache:latest           “/run.sh”             42 minutes ago      Up 31 minutes                                      nova-626bd8e0-cf1a-4891-aafc-620c464e8a94

3e2fe064d822        rastasheep/ubuntu-sshd:14.04   “/usr/sbin/sshd -D”   About an hour ago   Exited (0) About an hour ago                       test_sshd

8e79f9d8e357        fedora:latest                  “/bin/bash”           About an hour ago   Exited (0) About an hour ago                       evil_colden

9531ab33db8d        ubuntu:latest                  “/bin/bash”           About an hour ago   Exited (0) About an hour ago                       angry_bardeen

df6f3c9007a7        tutum/wordpress:latest         “/run.sh”             2 hours ago         Up About an hour                                   nova-3dbf981f-f28c-4abe-8fd1-09b8b8cad930

 

[root@ip-192-169-142-45 ~(keystone_demo)]# docker logs 3da1e94892aa

=> An empty or uninitialized MySQL volume is detected in /var/lib/mysql

=> Installing MySQL …

=> Done!

=> Creating admin user …

=> Waiting for confirmation of MySQL service startup, trying 0/13 …

=> Creating MySQL user admin with random password

=> Done!

========================================================================

You can now connect to this MySQL Server using:

mysql -uadmin -pfXs5UarEYaow -h -P

Please remember to change the above password as soon as possible!
MySQL user ‘root’ has no password but only allows local connections
========================================================================
141218 20:45:31 mysqld_safe Can’t log to error log and syslog at the same time.
Remove all –log-error configuration options for –syslog to take effect.

141218 20:45:31 mysqld_safe Logging to ‘/var/log/mysql/error.log’.
141218 20:45:31 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

[root@ip-192-169-142-45 ~(keystone_demo)]# mysql -uadmin -pfXs5UarEYaow -h 192.169.142.155  -P 3306
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.40-0ubuntu0.14.04.1 (Ubuntu)

Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others.

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.

MySQL [(none)]> show databases ;
+——————–+
| Database           |
+——————–+
| information_schema |
| mysql              |
| performance_schema |
+——————–+
3 rows in set (0.01 sec)

MySQL [(none)]>

*******************************************

Setup Ubuntu 14.04 with SSH access

*******************************************

# docker pull rastasheep/ubuntu-sshd:14.04

# . keystonerc_admin

# docker save rastasheep/ubuntu-sshd:14.04 | glance image-create –is-public=True   –container-format=docker –disk-format=raw –name rastasheep/ubuntu-sshd:14.04

# . keystonerc_demo

# nova boot –image “rastasheep/ubuntu-sshd:14.04” –flavor m1.tiny –key-name  osxkey    –nic net-id=5fcd01ac-bc8e-450d-be67-f0c274edd041 ubuntuTrusty

***********************************************************

Login to dashboard && assign floating IP via dashboard:-

***********************************************************

  [root@ip-192-169-142-45 ~(keystone_demo)]# nova list

+————————————–+————–+———+————+————-+—————————————–+

| ID                                   | Name         | Status  | Task State | Power State | Networks                                |

+————————————–+————–+———+————+————-+—————————————–+

| 3dbf981f-f28c-4abe-8fd1-09b8b8cad930 | WordPress    | SHUTOFF | –          | Shutdown    | demo_network=70.0.0.16, 192.169.142.153 |

| 7bbf887f-167c-461e-9ee0-dd4d43605c9e | lamp         | ACTIVE  | –          | Running     | demo_network=70.0.0.20, 192.169.142.156 |

| 39eef361-1329-44d9-b05a-f6b4b8693aa3 | mysql        | SHUTOFF | –          | Shutdown    | demo_network=70.0.0.19, 192.169.142.155 |

| f21dc265-958e-4ed0-9251-31c4bbab35f4 | ubuntuTrusty | ACTIVE  | –          | Running     | demo_network=70.0.0.21, 192.169.142.157 |

+————————————–+————–+———+————+————-+—————————————–+

[root@ip-192-169-142-45 ~(keystone_demo)]# ssh root@192.169.142.157

root@192.169.142.157’s password:

Last login: Fri Dec 19 09:19:40 2014 from ip-192-169-142-45.ip.secureserver.net

root@instance-0000000d:~# cat /etc/issue

Ubuntu 14.04.1 LTS \n \l

root@instance-0000000d:~# ifconfig

lo        Link encap:Local Loopback

inet addr:127.0.0.1  Mask:255.0.0.0

inet6 addr: ::1/128 Scope:Host

UP LOOPBACK RUNNING  MTU:65536  Metric:1

RX packets:0 errors:0 dropped:0 overruns:0 frame:0

TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:0

RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

nse49711e9-93 Link encap:Ethernet  HWaddr fa:16:3e:32:5e:d8

inet addr:70.0.0.21  Bcast:70.0.0.255  Mask:255.255.255.0

inet6 addr: fe80::f816:3eff:fe32:5ed8/64 Scope:Link

UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

RX packets:2574 errors:0 dropped:0 overruns:0 frame:0

TX packets:1653 errors:0 dropped:0 overruns:0 carrier:0

collisions:0 txqueuelen:1000

RX bytes:2257920 (2.2 MB)  TX bytes:255582 (255.5 KB)

root@instance-0000000d:~# df -h

Filesystem                                                                                         Size  Used Avail Use% Mounted on

/dev/mapper/docker-253:1-4600578-76893e146987bf4b58b42ff6ed80892df938ffba108f22c7a4591b18990e0438  9.8G  302M  9.0G   4% /

tmpfs                                                                                              1.9G     0  1.9G   0% /dev

shm                                                                                                 64M     0   64M   0% /dev/shm

/dev/mapper/centos-root                                                                             36G  9.8G   26G  28% /etc/hosts

tmpfs                                                                                              1.9G     0  1.9G   0% /run/secrets

tmpfs                                                                                              1.9G     0  1.9G   0% /proc/kcore

 

 References

1. http://cloudssky.com/en/blog/Nova-Docker-on-OpenStack-RDO-Juno/

2. https://www.mirantis.com/openstack-portal/external-tutorials/nova-docker-juno/