lost and found ( for me ? )

Ubuntu 14.04 : install Openstack Kilo all in one by using openstack-installer

Reference
http://openstack.astokes.org/guides/single-install
http://ronaldbradford.com/blog/installing-ubuntu-openstack-2015-06-01/

In my previous post, I installed openstack kilo within a LXC container, which was a little bit complex, especially network topology. So I installed Openstack on my host machine, Ubuntu.

Procedures are almost similar to the following URL.
http://lost-and-found-narihiro.blogspot.jp/2015/11/ubuntu-1404-install-openstack-kilo-all.html

Host OS
hattori@ubuntu:~$ tail -1 /etc/lsb-release
DISTRIB_DESCRIPTION="Ubuntu 14.04.3 LTS"
hattori@ubuntu:~$ uname -ri
3.13.0-68-generic x86_64

hattori@ubuntu:~$ dpkg -l lxc
ii  lxc            1.0.7-0ubunt amd64        Linux Containers userspace tools

openstack-installer at first creates a container and set up Kilo inside that container, so openstack-installer would refer /etc/lxc/default.conf on the host when creating a container, named “openstack-single-<user>”.

Here is a default.conf on the host.

/etc/lxc/default.conf
hattori@ubuntu:~$ cat /etc/lxc/default.conf
lxc.network.type = veth
lxc.network.link = lxcbr0
lxc.network.flags = up
lxc.network.hwaddr = 00:16:3e:xx:xx:xx

# allow netsted LXC
lxc.mount.auto = cgroup
lxc.aa_profile = lxc-container-default-with-nesting

# netsted KVM
lxc.cgroup.devices.allow = b 7:* rwm
lxc.cgroup.devices.allow = c 10:230 rw
lxc.cgroup.devices.allow = c 10:232 rw

lxc.mount.entry = /lib/modules lib/modules none bind,create=dir 0 0



install Kilo

hattori@ubuntu:~$ sudo apt-add-repository ppa:cloud-installer/experimental
hattori@ubuntu:~$  sudo apt-get update
hattori@ubuntu:~$  sudo apt-get install openstack
hattori@ubuntu:~$ openstack-install --upstream-ppa

select “Single”.




on the host machine.
hattori@ubuntu:~$ sudo lxc-ls -f
NAME                      STATE    IPV4        IPV6  AUTOSTART  
--------------------------------------------------------------
openstack-single-hattori  RUNNING  10.0.3.191  -     YES        
ubuntu-cn01               STOPPED  -           -     NO         
ubuntu-cn02               STOPPED  -           -     NO         
hattori@ubuntu:~$

hattori@ubuntu:~$ sudo ps aux | grep openstack-single-hattori | grep -v grep
root      9149  0.0  0.0  43156  1560 ?        Ss   22:58   0:00 lxc-start -n openstack-single-hattori -d -o /home/hattori/.cloud-install/lxc.log
root     11292  0.0  0.0   4440   640 pts/1    S+   22:59   0:00 /bin/sh -c lxc-attach -n openstack-single-hattori -- env DEBIAN_FRONTEND=noninteractive apt-get -qy -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold install openstack openstack-single
root     11293  0.0  0.0  34720  1536 pts/1    S+   22:59   0:00 lxc-attach -n openstack-single-hattori -- env DEBIAN_FRONTEND=noninteractive apt-get -qy -o Dpkg::Options::=--force-confdef -o Dpkg::Options::=--force-confold install openstack openstack-single
hattori@ubuntu:~$

on the host machine.
hattori@ubuntu:~$ cat .cloud-install/juju/environments.yaml
default: local

environments:
 local:
   type: local
   container: kvm
   lxc-clone: true
   authorized-keys-path: ~/.ssh/id_rsa.pub
   network-bridge: lxcbr0
   default-series: trusty
   admin-secret: "ubuntu"
   no-proxy: localhost

 openstack:
   type: openstack
   use-floating-ip: true
   use-default-secgroup: true
   network: ubuntu-net
   auth-url: http://keystoneurl:5000/v2.0/
   tenant-name: ubuntu
   region: RegionOne
   auth-mode: userpass
   username: ubuntu
   password: "ubuntu"
   no-proxy: localhost
hattori@ubuntu:~$


still setting up Kilo.

finished!

configure DNAT so that I can access to the Horizon from a remote machine.

My host machine has one IP address, 192.168.0.100.
I configured iptables as below so that I can access to the horizon over https://192.168.0.100:8080 from remote machines.

on the host machine.
hattori@ubuntu:~$ sudo lxc-ls -f
[sudo] password for hattori:
NAME                      STATE    IPV4                                 IPV6  AUTOSTART  
---------------------------------------------------------------------------------------
openstack-single-hattori  RUNNING  10.0.3.191, 10.0.6.1, 192.168.122.1  -     YES        

hattori@ubuntu:~$ sudo iptables -t nat -A PREROUTING -p tcp -d 192.168.0.100 --dport 8080 -j DNAT --to-destination 10.0.3.191:8080

access to the ‘openstack-single-hattori’ container and configure iptables.
ubuntu@openstack-single-hattori:~$ sudo iptables -t nat -A PREROUTING -p tcp -d 10.0.3.191 --dport 8080 -j DNAT --to-destination 10.0.6.95:443



access to the container.
on the host machine.

hattori@ubuntu:~$ sudo lxc-ls -f --active
NAME                      STATE    IPV4                                 IPV6  AUTOSTART  
---------------------------------------------------------------------------------------
openstack-single-hattori  RUNNING  10.0.3.191, 10.0.6.1, 192.168.122.1  -     YES        

hattori@ubuntu:~$ ssh ubuntu@10.0.3.191

ubuntu@openstack-single-hattori:~$

now inside the container.
install nova client.
ubuntu@openstack-single-hattori:~$ sudo apt-get install python-novaclient

ubuntu@openstack-single-hattori:~$ cat ~/.cloud-install/openstack-ubuntu-rc
export OS_USERNAME="ubuntu"
export OS_PASSWORD="ubuntu"
export OS_TENANT_NAME="ubuntu"
export OS_AUTH_URL="http://10.0.6.53:5000/v2.0"
export OS_REGION_NAME="RegionOne"
ubuntu@openstack-single-hattori:~$
ubuntu@openstack-single-hattori:~$ source ~/.cloud-install/openstack-ubuntu-rc
ubuntu@openstack-single-hattori:~$
ubuntu@openstack-single-hattori:~$ nova image-list
+--------------------------------------+---------------------------------------------------------------+--------+--------+
| ID                                   | Name                                                          | Status | Server |
+--------------------------------------+---------------------------------------------------------------+--------+--------+
| 57d649e8-0d64-4a0c-a1f3-dee5a7a86363 | auto-sync/ubuntu-trusty-14.04-amd64-server-20151105-disk1.img | ACTIVE |        |
| adf3247a-8ac1-4435-90e4-d97405e48b34 | auto-sync/ubuntu-trusty-14.04-amd64-server-20151105-disk1.img | ACTIVE |        |
| be3ce24e-ffca-47e1-9b8c-4f92c26a9f28 | auto-sync/ubuntu-trusty-14.04-amd64-server-20151105-disk1.img | ACTIVE |        |
| d86b3a4e-e696-4661-99e0-a3d24a3385e0 | auto-sync/ubuntu-trusty-14.04-amd64-server-20151105-disk1.img | ACTIVE |        |
+--------------------------------------+---------------------------------------------------------------+--------+--------+
ubuntu@openstack-single-hattori:~$

stop the lxc.
on the host OS.
hattori@ubuntu:~$ sudo lxc-stop -n openstack-single-hattori


hattori@ubuntu:~$ sudo cat /var/lib/lxc/openstack-single-hattori/config
# Template used to create this container: /usr/share/lxc/templates/lxc-ubuntu-cloud
# Parameters passed to the template: -F -u /home/hattori/.cloud-install/userdata.yaml
# For additional config options, please look at lxc.container.conf(5)

# Common configuration
lxc.include = /usr/share/lxc/config/ubuntu-cloud.common.conf

# Container specific configuration
lxc.mount.entry = /lib/modules lib/modules none bind,create=dir 0 0
lxc.mount.auto = cgroup
lxc.aa_profile = lxc-container-default-with-nesting
lxc.cgroup.devices.allow = b 7:* rwm
lxc.cgroup.devices.allow = c 10:230 rw
lxc.cgroup.devices.allow = c 10:232 rw
lxc.rootfs = /var/lib/lxc/openstack-single-hattori/rootfs
lxc.mount = /var/lib/lxc/openstack-single-hattori/fstab
lxc.utsname = openstack-single-hattori
lxc.arch = amd64

# Network configuration
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = lxcbr0
lxc.network.hwaddr = 00:16:3e:5f:c6:c5
lxc.mount.auto = cgroup:mixed
lxc.start.auto = 1
lxc.start.delay = 5
lxc.mount = /var/lib/lxc/openstack-single-hattori/fstab
hattori@ubuntu:~$

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.