Hi this is an  update on where I am with my poc of creating a bifost container 
for kolla.
As of  Wednesday evening I have reached my v0 poc goal

That goal was to demonstrate it was easy bifrost in a container with little to 
know changes.
This is further broken down as follows.

-        Create poc patch to split bifrost ironic install role into install, 
bootstrap and start phases

-        Use kolla build.py to build a container with all bifrost/ironic 
dependences installed by running
bifrost install phase as part of the docker build

-        Spawn an instance of the resulting container then bootstrap and start 
ironic by running bifrost install playbook  with only the bootstrap and run 
phases enabled

-        Enroll a physical node using the enroll-dynamic playbook

-        Deploy the default OS image to the physical node using the 
deploy-dynamic playbook

The attached file assume basic knowledge of how to build images with kola and 
documents how the command I
Ran to preform this poc.

Limitations of v0:


-        Only tested with centos source build

-        Fat container. Uses systemd as an init system in the container. (yes 
this works fine)

-        Requires privileged (required for networking and  mounting loopback 
devices)

-        Requires net=host (as an infrastructure container on the undercloud 
this shold be ok)

-        Requires /sys/fs/cgroups to be bind mounted for systemd

-        Requires /dev to be bind mounted  to allow building of Baremetal image

-        No integration with kola deploy playbooks or script to automate 
deployment (fix in v1)

-        No support for external config (fix in v1)

-        I wrote it in 12-18 hours so no comments or docs except the attachment

-        Ironic service done restart automatically on restarting container.( 
rerun install playbook with skip_boostrap=true and skip_install=true to fix)

Next steps:

Define scope of v1

-        Should I open a blueprint/spec/bug in kolla and or bifrost?

-        Kolla spec to cover container and ansible integration 
(https://github.com/SeanMooney/kolla/commit/bbbfc573dcd8e20ad912dedeecc0b3994832925f)

o   Support builds of bifrost container both source and binary with all 4 base 
OS

o   Support baremetal image customization via external config. (os,packages) 
and bring your own model to supply your own image.

o   Integrate with kolla deploy playbooks.

o   Add bifrost.rst to kolla docs

o   Thin containers or supervisord as a v2

-        Bifrost spec to cover ironic install  decomposition  
(https://github.com/SeanMooney/bifrost/commit/e223f4fe73871b76ce87999470a1efc43862671e)

o   Split install ironic playbook into 3 phases (install,bootstarp,start)

§  possible solutions. Skip_* as in poc, separate roles or tags

o   Replace use of sed for fixing hostname as it fails in a container
(https://github.com/openstack/bifrost/blob/master/playbooks/roles/bifrost-ironic-install/tasks/main.yml#L117-L123)

o   Introduce install_dib  to control if disk image build is installed of 
checking if the image should be built.

-        Testing: kolla ci job? Test in bifrost ci?

So this is the point I pause for feedback:
Does this sound like a reasonable next step?
Am I going in the wrong direction with this?
If I create spec or when I submit the code for review would anyone in 
particular like me to add them as reviewers?

Regards
Seán

# clone kolla biforst poc
git clone https://github.com/SeanMooney/kolla.git
cd kolla && git chekcout bifrost
# set up koll dependcies as normal
# generate kolla build
tox -e genconfig
#

modify kolla-build as follows.

set install_type to source

update bifrost-base as follows

[bifrost-base]

#
# From kolla
#

# Source location type (string value)
# Allowed values: local, git, url
type = git

# The location for source install (string value) location = 
https://github.com/SeanMooney/bifrost.git

# Git reference to pull, commit sha, tag or branch name (string value) 
reference = kolla


#build container
tools/build.py bifrost-systemd

manually run bifrost container.
docker run -it --net=host -v /dev:/dev -d --privileged --name bifrost
192.168.1.51:5000/kollaglue/centos-source-bifrost-systemd:2.0.0

# fix hosts file and add hostname to 127.0.0.1 line nano /etc/hosts

# generate ssh key
ssh-keygen

# source env variables
cd /bifrost
. env-vars
. /opt/stack/ansible/hacking/env-setup
cd playbooks/

# bootstap and start services (can be split using skip_bootstrap and
skip_start)
  ansible-playbook -vvvv -i /bifrost/playbooks/inventory/localhost
/bifrost/playbooks/install.yaml -e skip_install=true -e 
mysql_service_name=mysql  -e 
"ansible_python_interpreter=/var/lib/kolla/venv/bin/python" -e
network_interface=enp2s0

# at this point ironic is deployed and running check with "ironic node-list" 
should return with no nodes.

# create a yml file discribing your physical nodes ipmi credentials.

e.g. /tmp/servers.yml

---
cloud1:
     uuid: "31303735-3934-4247-3830-333132535336"
     driver_info:
       power:
         ipmi_username: "admin"
         ipmi_address: "192.168.1.30"
         ipmi_password: "root"
     nics:
       -
         mac: "1c:c1:de:1c:aa:53"
       -
         mac: "1c:c1:de:1c:aa:52"
     driver: "agent_ipmitool"
     ipv4_address: "192.168.1.10"
     properties:
       cpu_arch: "x86_64"
       ram: "24576"
       disk_size: "120"
       cpus: "16"
     name: "cloud1"

adjust as appropriate for your systems

# enroll physical nodes.
export BIFROST_INVENTORY_SOURCE=/tmp/servers.yml
ansible-playbook -vvvv -i inventory/bifrost_inventory.py enroll-dynamic.yaml -e 
"ansible_python_interpreter=/var/lib/kolla/venv/bin/python" -e
network_interface=enp2s0

# deploy nodes.
export BIFROST_INVENTORY_SOURCE=/tmp/servers.yml
ansible-playbook -vvvv -i inventory/bifrost_inventory.py deploy-dynamic.yaml -e 
"ansible_python_interpreter=/var/lib/kolla/venv/bin/python" -e
network_interface=enp2s0

at this point ironic should clean down your node and install the default deabin 
image.

not by default ssh is installed in the image but not enabled so you will have 
to acess the server phyically in recovery mode to enable the ssh service. this 
can be done remotely with ipmitool and serial over lan.
ipmitool -I lanplus -H 192.168.1.30 -U admin -P root sol
__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

Reply via email to