VScaler: Kolla Initial setup build and deployment (Newton)

From Define Wiki
Revision as of 12:19, 4 April 2017 by David (talk | contribs)
Jump to navigation Jump to search

Pre-install Notes

You'll need the following systems: (can be all-in-one, but i've split)

  1. kolla-build server (this is to build all the docker images) I've used the headnode of OpenHPC
  2. controller node(s)
  3. compute node(s)
  4. network node(s)
  5. storage node(s)

XFS Issues

Problems with XFS - Either use EXT4 or format the XFS partition with the flags below:

mkfs -t xfs -n ftype=1 /PATH/TO/DEVICE

If installing on kolla-build on a compute node, its missing loads of include files. (not a problem if using the headnode for buidling)

# NOTE: VNFS removes a lot of include files, ensure the following is commented out in:  /etc/warewulf/vnfs.conf
#hybridize += /usr/X11R6
#hybridize += /usr/lib/locale
#hybridize += /usr/lib64/locale
#hybridize += /usr/include
#hybridize += /usr/share/man
#hybridize += /usr/share/doc
#hybridize += /usr/share/locale

Missing header files on OpenHPC compute nodes

If you want to apply to a pre-deployed node and not faff around

# for some weird reason, glibc-headers is missing loads of files. Have to force an uninstall and re-install to fix on a compute node
rpm -e glibc-headers --nodeps
yum -y install glibc-headers
rpm -e glibc-devel --nodeps
yum -y install glibc-devel
rpm -e gmp-devel --nodeps
yum -y install gmp-devel
yum -y install glibc-devel
rpm -e kernel-headers --nodeps
yum -y install kernel-headers
yum -y install openssl-devel

# (WARNING BREAKS YUM) and check version is the same
rpm -e python-libs --nodeps
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/python-libs-2.7.5-48.el7.x86_64.rpm
rpm -ivh ./python-libs-2.7.5-48.el7.x86_64.rpm
# end wierdness!

Setup the kolla-build system

# remove openhpc and cobbler repo if they exist!
yum -y groupinstall 'Development Tools'
yum -y update
yum -y install epel-release
yum -y install python-pip python-devel
pip install -U pip
pip -V
# At this stage im at: 
#[root@node02 yum.repos.d]# pip -V 
#pip 9.0.1 from /usr/lib/python2.7/site-packages (python 2.7)
#[root@node02 yum.repos.d]# cat /etc/redhat-release 
#CentOS Linux release 7.3.1611 (Core)

Setup Docker to act as a registry

# Install docker 
curl -sSL https://get.docker.com/ | sh
usermod -aG docker root

# Setup the sysconfig file 
tee /etc/sysconfig/docker  <<-'EOF'
DOCKER_OPTS="--insecure-registry 10.10.10.1:4000"
EOF
 mkdir -p /etc/systemd/system/docker.service.d

# setup the service file
tee /etc/systemd/system/docker.service.d/kolla.conf <<-'EOF'
[Service]
MountFlags=shared
EnvironmentFile=-/etc/sysconfig/docker
#EnvironmentFile=-/etc/sysconfig/docker-storage
#EnvironmentFile=-/etc/sysconfig/docker-network
ExecStart=
ExecStart=/usr/bin/dockerd --insecure-registry 10.10.10.1:4000
#ExecStart=/usr/bin/dockerd $DOCKER_OPTS
EOF

# restart stuff 
systemctl daemon-reload
systemctl restart docker
systemctl status docker.service
systemctl enable docker.service
systemctl stop libvirtd.service
systemctl disable libvirtd.service

# last few packages 
pip install -U docker-py
pip install ansible==2.0.0

# start up the docker registry on the deployent node 
docker run -d -p 4000:5000 --restart=always -v /var/lib/docker/volumes/registry:/var/lib/registry --name registry registry:2

Setup and Install Kolla (release 3.0.4 / Newton)

git clone https://git.openstack.org/openstack/kolla
cd kolla/
git checkout stable/newton
cd ..
# Ref problem: http://stackoverflow.com/questions/42029545/pip-is-error-typeerror-call-takes-exactly-2-arguments-1-given
# vi /usr/lib/python2.7/site-packages/packaging/requirements.py
# Changed line 59:
# #MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker")
# MARKER_EXPR = originalTextFor(MARKER_EXPR)("marker")
pip install -r kolla/requirements.txt -r kolla/test-requirements.txt
pip install kolla/
cd kolla
cp -rvf etc/kolla /etc/
yum install python-devel libffi-devel openssl-devel gcc -y
pip install -U python-openstackclient python-neutronclient
pip install tox
tox -e genconfig

Kolla installation files

#setup the installation / build file
mkdir ~/kolla-deploy
cd ~/kolla-deploy
cp /usr/share/kolla/ansible/inventory/multinode ~/kolla-deploy
# Create default passwords for deployment - will populate /etc/kolla/passwords 
kolla-genpwd
# see below for inputs in globals
vi /etc/kolla/globals.yml
# this just covers the roles that nodes will have (can use all-in-one here) 
vi multinode


[root@gpu01 kolla]# egrep -v '(^#|^$)' /etc/kolla/globals.yml
---
kolla_internal_vip_address: "10.10.10.254"
docker_registry: "10.10.10.1:4000"
network_interface: "eth2"
neutron_external_interface: "eno1"

  
kolla-build --base centos --type binary --registry 10.10.10.1:4000 --push
# some will fail because binary candidates not found - you can build from source using (for e.g. murano / mistral didnt build)
# kolla-build --base centos --type source --registry 10.10.10.1:4000 --push
  1. check the docker image registry for all your images
docker images -a 
docker ps -a

Deploy and Test

kolla-ansible prechecks -i ./multinode
kolla-ansible pull -i ./multinode # make sure you can pull all the images 
kolla-ansible -vvv deploy -i ./multinode
kolla-ansible post-deploy # this creates the admin-openrc.sh, in /etc/kolla, credentials
# sometime you neeed add or remove a computer node or controller node, you should modify /usr/share/kolla/ansible/inventory/multinode, then execute:
# kolla-ansible upgrade -i ./multinode
pip install python-openstackclient
source /etc/kolla/admin-openrc.sh
/usr/share/kolla/init-runonce