openstack

warning: Creating default object from empty value in /data/web/1/000/027/003/273448/htdocs/panticz.de/modules/taxonomy/taxonomy.pages.inc on line 33.

OpenStack: Horizon

Configure start page
# /etc/kolla/horizon/custom_local_settings
# /etc/kolla/config/dev/horizon/custom_local_settings (kolla-ansible override)
HORIZON_CONFIG["user_home"] = "/project"

Links
https://docs.openstack.org/horizon/latest/contributor/ref/horizon.html
https://docs.openstack.org/mitaka/config-reference/dashboard/config-options.html

OpenStack: Cleanup project

# Delete VM
openstack server list --project=test-project --os-cloud=dev
openstack server delete test-project-vm

# Delete floating IP
openstack floating ip list --project=test-project --os-cloud=dev
openstack floating ip delete 1.2.3.4

# Delete router
openstack router list --project=test-project --os-cloud=dev
openstack subnet list --project=test-project --os-cloud=dev
openstack router remove subnet test-project-router test-project-subnet
openstack router delete test-project-router

# Delete subnet
openstack subnet list --project=test-project --os-cloud=dev

OpenStack: Cloud management with Ansible

# Fix; To utilize this module, the installed version ofthe shade library MUST be >=1.8.0
wget http://mirrors.kernel.org/ubuntu/pool/universe/p/python-shade/python-shade_1.30.0-2_all.deb -O /tmp/python-shade_1.30.0-2_all.deb
sudo dpkg -i /tmp/python-shade_1.30.0-2_all.deb

OpenStack multi cloud / user configurattion

Configure connections
# ~/.config/openstack/clouds.yaml
clouds:
admin-dev:
auth:
auth_url: http://keystone-admin.dev.example.com:35357/v3
project_name: admin
username: admin
user_domain_name: Default
project_domain_name: Default
interface: internal
foo-stage:
auth:
auth_url: http://api.stage.example.com:35357
project_name: fooproject
username: foo
user_domain_name: foodom
project_domain_name: foodom

Configure passwords
# ~/.config/openstack/secure.yaml
clouds:

OpenStack: Install OpenStack client

# install pyenv
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bashrc
exec "$SHELL"

# install python 3.5.x version into pyenv (DO NOT USE VERSIONS > 3.5.x)
apt install build-essential libbz2-dev libreadline-dev libssl-dev zlib1g-dev libsqlite3-dev wget curl libncurses5-dev libncursesw5-dev xz-utils libffi-dev liblzma-dev
pyenv install 3.5.6

OpenStack: Regenerate kolla password file

OS_ENV=dev

rm /etc/kolla/passwords.yml
cp /etc/kolla/config/passwords-${OS_ENV}.yml /etc/kolla/passwords.yml

# marge new password / reorder passwords
# kolla-genpwd -p /etc/kolla/passwords.yml
# cp /etc/kolla/passwords.yml /etc/kolla/config/passwords-${OS_ENV}.yml

cat /etc/kolla/config/passwords-${OS_ENV}.yml | cut -d" " -f1 > /etc/kolla/passwords.yml
kolla-genpwd -p /etc/kolla/passwords.yml
mv /etc/kolla/passwords.yml /etc/kolla/config/passwords-${OS_ENV}.yml
ln -s /etc/kolla/config/passwords-${OS_ENV}.yml /etc/kolla/passwords.yml

Links

ironic / bifrost

# load env
. /opt/stack/bifrost/env-vars

# list nodes
ironic node-list

# remove / shutdown existing node
ironic node-set-provision-state foo.example.com deleted

# load node configuration
export BIFROST_INVENTORY_SOURCE=/opt/openstack-prepare-baremetal/bifrost/json/foo.example.com.json

# add new node
ansible-playbook -i inventory/bifrost_inventory.py enroll-dynamic.yaml
ironic node-update foo.example.com add properties/capabilities='boot_mode:uefi'

# deploy
ansible-playbook -v -i inventory/bifrost_inventory.py deploy-dynamic.yaml

# show node details

Install OpenStack with Kolla-ansible under Ubuntu

Install all-in-one
apt-get install python-dev libffi-dev gcc libssl-dev python-selinux python-setuptools ansible pip
pip install kolla-ansible
cp -r /usr/local/share/kolla-ansible/etc_examples/kolla /etc/
cp /usr/local/share/kolla-ansible/ansible/inventory/* .
kolla-genpwd
cp /etc/kolla/globals.yml{,org}
vi /etc/kolla/globals.yml
sed -i 's|#kolla_base_distro: "centos"|kolla_base_distro: "ubuntu"|g' /etc/kolla/globals.yml
sed -i 's|#kolla_install_type: "binary"|kolla_install_type: "source"|g' /etc/kolla/globals.yml

Syndicate content