Skip to content

About

OSL OpenStack cookbook

Topics

Resources

Stars

7 stars

Watchers

13 watching

Forks

Latest commit

 

History

1,459 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

osl-openstack Cookbook

Cookbook for deploying OpenStack at the OSUOSL

Supported Platforms

  • OpenStack Yoga release, as the OSL-built osuosl-openstack-* venv RPMs from openstack-packaging (one venv per service under /opt/openstack/<svc>), via the :osuosl source of osl_repos_openstack
  • AlmaLinux 9

The shared messaging tier (ops_messaging, ops_coordination) also runs on AlmaLinux 10.

Package updates

Chef, not dnf-automatic, upgrades the osuosl-openstack-* RPMs:

  • osl_openstack_client declares a dnf_automatic_policy 'osl-openstack' that excludes osuosl-openstack-* from base's dnf-automatic baseline, so the 10:10 timer leaves them alone.
  • Each venv RPM is a package resource with action :upgrade, so a release published to the node's openstack/<release>/ repo is installed on the next converge.
  • On one controller per cloud, the db syncs run when a package's version differs from the one recorded in /var/lib/osl-openstack/db-sync/<service>, and the version is recorded after a successful sync. That controller is the ha.keepalived.primary one in the cloud's data bag item, or any controller the ha block doesn't list.
  • Each service restarts at the end of the run that upgraded its package, after that run's syncs. Nothing orders controllers or computes against each other yet.

A config template change still triggers its service's db sync, on that same controller.

Release upgrades

The release key in a cloud's openstack data bag item names its target OpenStack release (default yoga). Chef stages the next release on every node and never moves a node across it; the move is one window per cloud, driven from the jumphost:

  • osl_openstack_client reads the installed release from the RPMs' markers, stages the target, and raises instead of downgrading or skipping a release.
  • /usr/local/sbin/openstack-node-upgrade is each node's part of a window.
  • recipe[osl-openstack::upgrade_runner] on the jumphost installs openstack-upgrade <cloud> <phase>, which sequences the window and its rollback; openstack-upgrade <cloud> upgrade runs the whole window with pauses at its decision points.

docs/RELEASE_UPGRADES.md has the runbook, the points of no return and the rollback.

ppc64le compute kernels

The compute recipe picks the KVM-capable kernel from the CPU:

  • POWER10: the CentOS Kmods SIG 6.18 kernel via osl_repos_centos_kmods, because AlmaLinux's kernel-kvm (5.14) lacks the nested-v2 support needed to host KVM guests inside a PowerVM LPAR
  • POWER9 bare metal: AlmaLinux's kernel-kvm

kvm_hv is only loaded when the running kernel ships it as a module, so the first converge on a new host installs the KVM kernel and the module loads after the reboot.

Compute libvirt daemon

Computes run the monolithic libvirtd, socket-activated, with live migration on libvirtd-tcp.socket (16509). libvirt's package presets enable the modular daemons (virtqemud, virtproxyd, virtnetworkd and five more) instead, and each of their sockets conflicts with libvirtd.socket. Left enabled, they can win that conflict at boot, so libvirtd-tcp.socket fails and migrations to the host are refused. The compute recipe masks all of them. Their sockets are disabled first; the services are only masked, since disabling virtqemud.service also disables the virtlogd and virtlockd sockets through its Also= line.

systemd won't start a socket while its service runs. When libvirtd is running with one of its four sockets down, the recipe stops libvirtd first, which also stops openstack-nova-compute (Requires=libvirtd.service), then starts the sockets and both services again. Guests keep running: libvirtd uses KillMode=process. Don't run systemctl preset on these units, and never unmask virtqemud.service without disabling it, which would bring the conflict back at the next boot.

Connection tracking

Computes bridge guest traffic, and network controllers route it through the neutron L3 and DHCP agents, so both pass it through the host's conntrack table. network_common, which both include, sizes that table from the cloud's data bag item:

Key Default Sets
compute.conntrack.max 2097152 net.netfilter.nf_conntrack_max
compute.conntrack.tcp_timeout_established 86400 net.netfilter.nf_conntrack_tcp_timeout_established
compute.conntrack.hashsize max / 4 the nf_conntrack module's hashsize, at boot and live

A full table drops new connections, VRRP adverts included; on Nov 19 2026 that took the x86 API VIP down for about 40 minutes. The maximum is global, but the established timeout reaches only the host namespace: the qrouter-* and qdhcp-* namespaces keep the kernel's 5 days, and each namespace's count is checked against the maximum on its own.

HA controllers

A cloud whose data bag item has an ha block runs two controllers. keepalived holds the API VIP (one IPv4 and one IPv6 instance in a sync group), and haproxy on both controllers binds it and fronts the per-host Apache and uWSGI APIs. The ha.keepalived.primary controller starts as MASTER, and the one with the higher ha.keepalived.priority takes the VIP back after a failover.

The master sends a gratuitous ARP and an unsolicited neighbour advert for the VIP every 10 seconds (garp_master_refresh). Without it, keepalived announces the VIP only when a controller becomes master. On Nov 19 2026 the backup held the VIP for 3 seconds and gave it back while the master never left MASTER, so the gateway kept the backup's MAC and IPv4 to the VIP failed until someone ran arping by hand. The refresh limits that to 10 seconds.

haproxy also answers a probe on each VIP address family at port 9184, with no backend: it returns openstack_vip_up 1 from /etc/haproxy/vip_probe.prom. Prometheus on mon2 scrapes it per family from a routed network, so a VIP that stops answering on IPv4 or IPv6 alone still shows. The port is open to OSL's own ranges.

Controller metrics

osl-openstack::mon gives controllers two cron jobs that write files for node_exporter's textfile collector in /var/lib/node_exporter/:

Job Every File Metrics
openstack-prometheus 10 minutes openstack.prom openstack_instances, openstack_projects, openstack_start_time, openstack_completion_time, read through the API
openstack-netns-conntrack minute openstack_netns_conntrack.prom openstack_netns_conntrack_entries{netns}, each qrouter-* and qdhcp-* namespace's conntrack count, and openstack_netns_conntrack_last_success_timestamp_seconds

The namespace counts don't depend on the API, so they keep coming when the API is down. node_exporter's own node_nf_conntrack_entries covers only the host namespace.

WSGI services

The API services run as uWSGI systemd units shipped by their RPMs. The cookbook renders each unit's ini from templates/uwsgi.ini.erb. Apache keeps the vhost on the service port and proxies it to the unit's socket through mod_proxy_uwsgi. A config change restarts the uWSGI unit, not Apache.

Service Port uWSGI unit ini Socket
keystone 5000 keystone-uwsgi /etc/keystone/keystone-uwsgi.ini /run/keystone/uwsgi.sock
placement 8778 placement-uwsgi /etc/placement/placement-uwsgi.ini /run/placement/uwsgi.sock
nova-api 8774 openstack-nova-api /etc/nova/nova-api-uwsgi.ini /run/nova/api-uwsgi.sock
nova-metadata 8775 openstack-nova-metadata /etc/nova/nova-metadata-uwsgi.ini /run/nova/metadata-uwsgi.sock
cinder-api 8776 openstack-cinder-api /etc/cinder/cinder-api-uwsgi.ini /run/cinder/api-uwsgi.sock
horizon 443 horizon-uwsgi /etc/horizon/horizon-uwsgi.ini /run/horizon/uwsgi.sock

Horizon reads /etc/horizon/local_settings.py through a symlink in its venv. Apache serves /static from /var/www/horizon/static, which collectstatic and compress fill whenever the settings or the vhost change.

Operator tools

Controllers get nova-fix-flavors, nova-cold-migrate-host, nova-resize-debris-check and nova-maintenance-notice in /usr/local/sbin; docs/NOVA_FIX_FLAVORS.md covers the first. Local-storage computes get nova-restore-local-disk, which puts back the Ceph root that a resize to a local flavor leaves behind; docs/CROSS_STORAGE_RESIZE.md has the whole procedure and the audit that spots such moves.

Migrating from RDO

Every node has moved from RDO to the venv RPMs, so migrate-venv.sh and the RDO package check were retired; git history has the procedure.

Since the move off RDO, services log to journald, not /var/log/<svc>/*.log. osuosl-openstack-selinux replaces openstack-selinux and labels /opt/openstack, so each daemon runs in the same SELinux domain as under RDO.

Resources

Every service recipe starts with osl_openstack_client and registers itself in keystone with osl_openstack_service_user and osl_openstack_api. The lower-level keystone resources (osl_openstack_user, _service, _endpoint, _domain, _project, _role) look an object up before creating it, so re-running them against an existing cloud makes no API writes.

osl_openstack_client

Adds the OSL OpenStack repository, upgrades osuosl-openstack-cli and osuosl-openstack-selinux, and excludes osuosl-openstack-* from dnf-automatic. On a node still running RDO, it stops the run first (see Migrating a node from RDO).

Property Default Description
firewall false Also open the service's ports via osl_firewall_openstack
openrc false Also write /root/openrc via osl_openstack_openrc
osl_openstack_client 'image' do
  firewall true
  openrc true
end

osl_openstack_service_user

Creates a user in the default domain and grants it admin on the service project.

Property Default Description
user_name resource name Keystone user name
password (required) The user's password

osl_openstack_api

Creates a keystone service and its admin, internal and public endpoints, named <endpoint_name>-<interface> in the run.

Property Default Description
service_name resource name Keystone service name
type (required) Service type, e.g. image
endpoint_name (required) Endpoint name, e.g. image
url (required) URL used for all three interfaces
region (required) Region the endpoints are registered in
osl_openstack_api 'glance' do
  type 'image'
  endpoint_name 'image'
  url 'http://controller.example.org:9292'
  region 'RegionOne'
end

Multi-host test integration

This cookbook utilizes kitchen-terraform to test deploying various parts of this cookbook in multiple nodes, similar to that in production.

Prereqs

  • Chef/Cinc Workstation
  • Terraform
  • kitchen-terraform
  • OpenStack cluster

Ensure you have the following in your .bashrc (or similar):

export TF_VAR_ssh_key_name="$OS_SSH_KEYPAIR"

Supported Deployments

  • Chef-zero node acting as a Chef Server
  • Database node
  • Ceph node
  • Controller node (MQ, Neutron, public apis, web interface, etc)
  • Compute nodes, one by default and up to three (also includes Cinder volume service)
  • Jumphost running the release upgrade runner

Testing

First, generate some keys for chef-zero and then simply run the following suite.

# Only need to run this once
$ chef exec rake create_key
$ KITCHEN_YAML=kitchen.multi-node.yml kitchen test multi-node

If you want to test multi-regions, you need to do the following instead:

$ export TF_VAR_region2=1
$ KITCHEN_YAML=kitchen.multi-node.yml kitchen test multi-node

To test the upgrade runner's canary and a parallel batch, build three computes instead of one. TF_VAR_computes takes 0 to 3, and each compute is an m2.local.8c8m100d, so check the shared quota first:

$ export TF_VAR_computes=3
$ KITCHEN_YAML=kitchen.multi-node.yml kitchen test multi-node

compute is always the upgrade canary. Each compute gets two upgrade-vm-<host>-N VMs, the first with a volume, from /root/upgrade_vms.sh on controller1. Changing the count later rebuilds only the computes: a dropped compute first has its VMs, nova service, neutron agents and chef node removed. An environment built before this count existed needs a kitchen destroy multi-node first.

Be patient as this will take a while to converge all of the nodes (approximately 40 minutes).

Access the nodes

Unfortunately, kitchen-terraform doesn't support using kitchen console so you will need to log into the nodes manually. To see what their IP addresses are, just run terraform output which will output all of the IPs.

# You can run the following commands to login to each node
$ ssh almalinux@$(terraform output controller)
$ ssh almalinux@$(terraform output compute)
# With TF_VAR_computes=3
$ ssh almalinux@$(terraform output compute2)
$ ssh almalinux@$(terraform output compute3)
# The upgrade runner (docs/RELEASE_UPGRADES.md has the rehearsal)
$ ssh almalinux@$(terraform output jumphost)
# If you're testing multi-regions
$ ssh almalinux@$(terraform output controller_region2)
$ ssh almalinux@$(terraform output compute_region2)

# Or you can look at the IPs for all for all of the nodes at once
$ terraform output
# Or let the rehearsal helper pick the address and a known_hosts that survives rebuilds
$ test/multinode-rehearse.sh nodes
$ test/multinode-rehearse.sh ssh controller1

Interacting with the chef-zero server

All of these nodes are configured using a Chef Server which is a container running chef-zero. You can interact with the chef-zero server by doing the following:

$ CHEF_SERVER="$(terraform output chef_zero)" knife node list -c test/chef-config/knife.rb
controller
compute
$ CHEF_SERVER="$(terraform output chef_zero)" knife node edit -c test/chef-config/knife.rb

In addition, on any node that has been deployed, you can re-run cinc-client like you normally would on a production system. This should allow you to do development on your multi-node environment as needed. Just make sure you include the knife config otherwise you will be interacting with our production chef server!

Using Terraform directly

You do not need to use kitchen-terraform directly if you're just doing development. It's primarily useful for testing the multi-node cluster using inspec. You can simply deploy the cluster using terraform directly by doing the following:

The x86 cloud's API rejects a source that opens more than 50 connections in 10 seconds, so keep terraform's parallelism at 4, as kitchen.multi-node.yml does:

# Sanity check
$ terraform plan
# Deploy the cluster
$ terraform apply -parallelism=4
# Destroy the cluster
$ terraform destroy -parallelism=4

Cleanup

# To remove all the nodes and start again, run the following test-kitchen command.
$ kitchen destroy multi-node

# To refresh all the cookbooks, use the following command.
$ CHEF_SERVER="$(terraform output chef_zero)" chef exec rake knife_upload

Contributing

  1. Fork the repository on Github
  2. Create a named feature branch (i.e. add-new-recipe)
  3. Write you change
  4. Write tests for your change (if applicable)
  5. Run the tests, ensuring they all pass
  6. Submit a Pull Request

License and Authors

Author:: Oregon State University (chef@osuosl.org)

About

OSL OpenStack cookbook

Topics

Resources

Stars

7 stars

Watchers

13 watching

Forks

Releases

Packages

Used by

Contributors

Languages