- Published on
HW7. Building OpenStack and Linux Container Networking
- Authors

- Name
- seren-wib
Contents
- 0. Lab Environment
- 1. Preparing the OpenStack Installation
- Interface for the External Network
- Preparing the Host
- The cirros Image and Kolla-Ansible
- globals.yml
- 2. Deploying OpenStack
- Client Setup and Initial Resources
- 3. Creating Instances from the Dashboard
- stackvm-1 from the cirros Image
- Uploading an Image and stackvm-2
- 4. Access with the Command-Line Tools
- 5. Problems During the Lab
- Problem 1. Deployment Inside the Rocky VM Never Finished
- Problem 2. cirros Hangs at virtio_blk
- Problem 3. docker and dbus Modules Missing in prechecks
- Problem 4. Dashboard Image Upload Blocked by CORS
- Problem 5. Empty VNC Console
- 6. Linux Container Networking
- Creating a Network Namespace
- Connecting Namespaces with veth
- Connecting Through a Bridge
- Connecting to the Root Network Namespace
- External Access with NAT
- 7. Exercises
- Ch13-5. OpenStack Services and Their Roles
- Ch14-3. A Case Where a Container-Based Service Is More Efficient
- Ch15-9. Building the Network Setup in Figure 15.12
This homework covers the labs in chapters 13 to 15 of the textbook. The first half deploys OpenStack on a single node with Kolla-Ansible and creates instances from the dashboard and the command-line tools. The second half builds a container network (the setup on slide p67) by hand with Linux network namespaces. I first installed OpenStack inside a Rocky VM as the slides do, but gave up after running the deployment 8 times over more than 6 hours. That process is written up separately in section 5.
0. Lab Environment
I used the same Ubuntu host as since HW2 (Ubuntu 24.04 aarch64 on UTM on an Apple M3 Mac, 9.7GiB of memory, 6 vCPUs). Because the host is aarch64, I used aarch64 builds of every image, and I noted under each figure where commands differ from the slides.
- OpenStack: Installed directly on the Ubuntu host instead of adding one more VM level. Installing it inside a Rocky VM makes a three-level nesting of Mac → UTM → Ubuntu → KVM → Rocky, and the deployment never finished because of timeouts.
- Linux containers: Done in a Rocky Linux 10.2 aarch64 VM,
lxc.cloud.org, created on the host's KVM.
Ubuntu host yoosung-vm (enp0s1 192.168.64.4 = internal VIP, dashboard http://192.168.64.4)
├─ Docker containers: keystone, glance, nova, neutron, placement, heat, horizon, mariadb, rabbitmq ...
├─ veth1 (neutron_external_interface) ⇄ veth0
├─ Instances (KVM): stackvm-1, stackvm-2, stackvm-3 ── demo-net 10.0.0.0/24
└─ KVM ─ lxc.cloud.org (Rocky 10.2) ← network namespace lab
| Slides | This environment |
|---|---|
| x86 PC → VirtualBox → Rocky Linux (2 levels) | M3 Mac → UTM → installed directly on the Ubuntu host (2 levels) |
| 2 NICs enp0s3·enp0s8 | One NIC enp0s1 + veth pair veth0↔veth1 for the external network |
| firewalld·SELinux·chronyd settings | Host libvirt stopped, ufw·timedatectl checked |
dnf install | apt-get install (Ubuntu names of the same packages) |
kolla-ansible stable/2026.1, rocky images | stable/2026.2, ubuntu images + tag suffix -aarch64 |
| Separate internal VIP address + haproxy | enable_haproxy: "no", VIP = host IP |
| cirros-0.5.1-x86_64 | cirros-0.5.1-aarch64, with a copy that has pci=nomsi in the kernel arguments for instances |
| Dashboard VNC console | "Log" tab (aarch64 cirros outputs to serial) |
| External interface for the container lab enp0s3 10.0.2.15 | enp1s0 192.168.122.16 (libvirt NAT) |
1. Preparing the OpenStack Installation
Interface for the External Network
The slides hand enp0s8, one of two NICs, entirely over to the neutron external network. This host has only one NIC, enp0s1, and handing it over would cut off access to the host, so I created a veth pair with NetworkManager and used one end (veth1) as the external interface.
ip -br addr | grep -v vnet
sudo nmcli con add type veth con-name veth0 ifname veth0 veth.peer veth1 ipv4.method disabled ipv6.method disabled
sudo nmcli con add type veth con-name veth1 ifname veth1 veth.peer veth0 ipv4.method disabled ipv6.method disabled
ip -br link show type veth

Host interfaces and creating the veth pair for the external network. veth1 takes the place of enp0s8 in the slides
Preparing the Host
Kolla runs libvirt in the nova_libvirt container, and if the libvirt installed on the host in HW6 is still running, prechecks stops. I turned off every libvirt unit on the host and checked the firewall and time synchronization. Units given as a glob are not disabled, so I listed them one by one.
sudo systemctl disable --now libvirt-guests.service libvirtd.service virtlockd.service virtlogd.service \
libvirtd-admin.socket libvirtd-ro.socket libvirtd.socket virtlockd-admin.socket virtlockd.socket \
virtlogd-admin.socket virtlogd.socket
systemctl is-active libvirtd libvirtd.socket virtlogd
sudo ufw status
timedatectl | grep -E 'synchronized|NTP'

Stopping the host's libvirt services, confirming the firewall is inactive, checking time synchronization. Corresponds to slides 16–17
sudo apt-get update
sudo apt-get install -y git python3-dev python3-venv libffi-dev gcc libssl-dev wget

Installing dependency packages. The same packages installed with apt-get instead of dnf as in the slides
The cirros Image and Kolla-Ansible
sudo su -
wget http://download.cirros-cloud.net/0.5.1/cirros-0.5.1-aarch64-disk.img
python3 -m venv ~/venv
source ~/venv/bin/activate
pip install -U pip

Downloading the cirros image and creating a Python virtual environment. The host is aarch64, so cirros-0.5.1-aarch64-disk.img is used
The slides use stable/2026.1, but when I looked up the Kolla images on quay.io, the 2026.1 aarch64 tags existed only for Debian and Ubuntu, and Rocky aarch64 was available from 2026.2. So I installed stable/2026.2.
pip install git+https://opendev.org/openstack/kolla-ansible@stable/2026.2
mkdir -p /etc/kolla
cd /etc/kolla
cp -r ~/venv/share/kolla-ansible/etc_examples/kolla/* /etc/kolla
cp ~/venv/share/kolla-ansible/ansible/inventory/all-in-one /etc/kolla
kolla-ansible install-deps
kolla-genpwd

Installing Kolla-Ansible and copying the configuration files to /etc/kolla

Installing the Ansible Galaxy dependencies with kolla-ansible install-deps
kolla-genpwd fills passwords.yml with the service passwords. The dashboard admin password is the value of keystone_admin_password, and I masked the value when printing it.
grep keystone_admin_password passwords.yml | sed 's/: .*/: ********/'

Generating passwords with kolla-genpwd. The admin password value is masked in the output
globals.yml
Five values changed compared with the slides.
kolla_base_distro: "ubuntu": The host is Ubuntu, so I used the Ubuntu builds of the container images too.network_interface: "enp0s1",neutron_external_interface: "veth1"enable_haproxy: "no",kolla_internal_vip_address: "192.168.64.4": With a single node, I turned off the load balancer (haproxy·keepalived) and set the VIP to the host IP.openstack_tag_suffix: "-aarch64": With the default"", it pulls the2026.2-ubuntu-nobletag, which has no arm64 manifest.
sed -i -e 's/^#kolla_base_distro:.*/kolla_base_distro: "ubuntu"/' \
-e 's/^#network_interface:.*/network_interface: "enp0s1"/' \
-e 's/^#neutron_external_interface:.*/neutron_external_interface: "veth1"/' \
-e 's/^#\?kolla_internal_vip_address:.*/kolla_internal_vip_address: "192.168.64.4"/' \
-e 's/^#enable_haproxy:.*/enable_haproxy: "no"/' globals.yml
echo 'openstack_tag_suffix: "-aarch64"' >> globals.yml
To upload images from the dashboard, glance has to allow the dashboard address through CORS.
[cors]
allowed_origin = http://192.168.64.4,http://localhost:8080
allow_headers = Content-Type,X-Auth-Token,X-CSRFToken,X-Image-Meta-Checksum,Content-MD5,X-OpenStack-Request-ID

globals.yml settings and the glance CORS setting. http://localhost:8080 was added after connecting to the dashboard (Problem 4)
2. Deploying OpenStack
kolla-ansible bootstrap-servers -i ./all-in-one
pip install docker dbus-python
kolla-ansible prechecks -i ./all-in-one --use-test-images
time kolla-ansible deploy -i ./all-in-one > /root/deploy.log 2>&1
grep -A1 'PLAY RECAP' /root/deploy.log | tail -2

bootstrap-servers succeeded (failed=0). Host preparation such as installing Docker

prechecks succeeded (failed=0). The virtual environment lacked the Docker SDK and dbus-python, so pip install docker dbus-python was run first
The deployment took 13 minutes 22 seconds and finished with ok=375, failed=0. On failure, service passwords can appear in plain text in the output, so I wrote the log to a file and printed only the result summary.

deploy succeeded (ok=375, failed=0), 13 minutes 22 seconds
Client Setup and Initial Resources
pip install python-openstackclient -c https://releases.openstack.org/constraints/upper/2026.2
kolla-ansible post-deploy -i ./all-in-one
mkdir -p ~/.config/openstack
cp /etc/kolla/clouds.yaml ~/.config/openstack/
export OS_CLOUD=kolla-admin
openstack service list

Installing the OpenStack client, generating clouds.yaml with post-deploy, setting OS_CLOUD=kolla-admin

openstack service list. 7 services registered
init-runonce is an example script that creates the external network, internal network, cirros image, key pair and flavors in one go. I passed the external network range as environment variables.
EXT_NET_CIDR='192.168.56.0/24' EXT_NET_RANGE='start=192.168.56.150,end=192.168.56.199' \
EXT_NET_GATEWAY='192.168.56.1' ~/venv/share/kolla-ansible/init-runonce
openstack flavor list

Creating the external network (public1), internal network (demo-net), cirros image, key pair and flavors with init-runonce

openstack flavor list
3. Creating Instances from the Dashboard
I connected to the dashboard from a browser on the Mac through an SSH tunnel (localhost:8080 → 192.168.64.4:80). The username is admin and the password is keystone_admin_password in passwords.yml.
The cirros used for instances is not the original but a copy with pci=nomsi in the kernel arguments. The original hung at the disk detection stage during boot (Problem 2).

Dashboard login screen

Overview screen after login
stackvm-1 from the cirros Image

"Launch" on the cirros image in the image list

Entering the instance name stackvm-1 and a description

Source: the cirros image is allocated

Flavor: m1.tiny selected

Network: demo-net selected, then "Launch Instance"

stackvm-1 created (Active, Running)
Uploading an Image and stackvm-2

Create Image: name mycirros, file upload, format QCOW2, shared

mycirros registered (Active)

Creating instance stackvm-2 from mycirros

Source: mycirros

Flavor: m1.tiny

Network: demo-net

Two instances running

Console output of stackvm-2. Booted up to the login prompt. aarch64 cirros outputs to serial instead of the display (VGA), so it was checked in the "Log" tab instead of the "Console" tab
4. Access with the Command-Line Tools
openstack user list
openstack service list
openstack server list
openstack image list

openstack user list, openstack service list

openstack server list, openstack image list
The default output of server create has many columns, and lines break at the terminal width. I picked only the columns I wanted with -c.
openstack server create --image mycirros --flavor m1.tiny --network demo-net \
-c id -c name -c status -c image -c flavor -c created stackvm-3
openstack server list
openstack server stop stackvm-3
openstack server start stackvm-3

Creating stackvm-3 with openstack server create (BUILD)

Three instances ACTIVE

SHUTOFF with server stop, back to ACTIVE with server start
An instance is ultimately a domain of the libvirt inside the nova_libvirt container. Looking with virsh inside the container shows three of them, and virsh console attaches to the serial console.
docker exec nova_libvirt virsh list
docker exec -it nova_libvirt virsh console instance-00000005

virsh list in the nova_libvirt container. Three instances running as libvirt domains

Connecting to stackvm-1 (instance-00000005) with virsh console, logging in, writing and checking hello.txt
5. Problems During the Lab
Problem 1. Deployment Inside the Rocky VM Never Finished
At first I created a Rocky VM (openstack, 8GiB, 4 vCPUs) as in the slides and installed all-in-one inside it. The slides have two levels, x86 PC → VirtualBox → Rocky, but in this environment it becomes three levels of nesting: Mac → UTM → Ubuntu → KVM → Rocky. On top of that, Kolla starts dozens of containers.
bootstrap-servers and prechecks passed. These were the measurements 37 minutes after deploy started.
| Measurement | Value |
|---|---|
| Rocky load average (4 vCPUs) | 28–33, I/O wait 0 |
| Ubuntu host CPU steal | 55–59% |
| CPU of the VM process on the Mac | 285% |
50 runs of /bin/true (Ubuntu / Rocky) | 0.013 s / 0.908 s (about 70×) |
python3 -c pass (Rocky) | 2.9 s |
The bottleneck was neither disk nor network but the cost of going through three layers of virtualization every time a process is created. From then on, Kolla's timeout defaults broke one by one.
| Run | Time | Result | What broke and the fix |
|---|---|---|---|
| 1 | 12:29–13:20 | Stuck at rabbitmq for 25 minutes | The healthcheck rabbitmq-diagnostics ping, run every 30 seconds, never finished and 22 piled up → enable_container_healthchecks: "no" |
| 2 | 13:28–13:55 | Failed (ok=33) | Containers created in run 1 kept their healthcheck settings and piled up again, docker ps 40 seconds → kolla-ansible destroy (3 min 26 s) |
| 3 | 14:00–14:37 | Failed (ok=204) | keystone bootstrap rc=1 after 4 min 59.8 s. The same command run by hand succeeded in 37 seconds |
| 4 | 14:37–15:43 | Failed (ok=232) | ovs-vsctl -t 5 didn't finish within 5 seconds, SIGALRM → timeout: 60 on the openvswitch·ovn-controller roles |
| 5 | 15:46–16:25 | Failed (ok=287) | nova API 503. The keepalived check (2-second interval, FAULT after 2 failures) didn't finish in time, 49 FAULTs, each dropping the VIP for 20–40 seconds → interval 10, timeout 60, fall 6 |
| 6 | 16:28–16:52 | Failed (ok=281) | Same 503 with 0 FAULTs. The nova_api uwsgi started while the VIP was missing in run 5 stayed in a no python application found state → docker restart nova_api nova_metadata |
| 7 | 16:56–17:49 | Failed (ok=343) | Docker API ReadTimeout (default 120 seconds) in the neutron restart handler. Load average 128–144, 3 min 41 s for one docker ps -q → docker_client_timeout: 600, worker count 1 |
| 8 | 17:56–18:46 | Stopped | Most containers restarting because of changed settings, load average 113 |
Run 7 reached ok=343, so a few more runs might have finished the deployment itself. I stopped there anyway for two reasons.
- There is no
/dev/kvminside Rocky, so nova has to start instances with TCG (software emulation). With emulation on top of a place where process creation is 70 times slower, there was no telling whether the instance labs would work. - What the homework asks for is "the result of building OpenStack", and the Rocky VM in the slides is a means of building it.
So I deleted the Rocky VM, removed one level, and installed directly on the Ubuntu host. Ubuntu has /dev/kvm, so nova uses KVM directly. With the same Kolla version, the first deployment finished with failed=0 in 13 minutes 22 seconds.
Three lessons remain.
- Each added level of nesting breaks, in turn, timeout defaults that were assumed to be "long enough". The order was healthcheck 30 seconds →
ovs-vsctl5 seconds → keepalived 2 seconds → Docker API 120 seconds. - Kolla deploy does not restart containers whose settings haven't changed. A service that failed at startup (uwsgi that couldn't load the app) stays that way even if the deployment is run again, so it has to be restarted by hand.
- Failure messages print the command line as is, and that command line contains service passwords in plain text. I wrote the log to a file and showed only PLAY RECAP on screen.
Problem 2. cirros Hangs at virtio_blk
The first instance created on the Ubuntu host hung during boot right after the virtio_blk message. CPU was at 100% and the guest clock didn't go past 9 seconds. cirros 0.6.3 was the same.
It is the same symptom as the MSI interrupt problem under nested virtualization that I hit when installing Rocky aarch64 on KVM in HW6. As then, adding pci=nomsi to the kernel arguments makes it use legacy interrupts instead of MSI. cirros aarch64 boots with GRUB from the EFI partition, so I copied the image, attached it to a block device with qemu-nbd, mounted the EFI partition, and appended pci=nomsi to the end of the kernel line in EFI/ubuntu/grub.cfg.
modprobe nbd max_part=16
cp /root/cirros-0.5.1-aarch64-disk.img /root/cirros-nomsi.img
qemu-nbd --connect /dev/nbd0 /root/cirros-nomsi.img
lsblk -o NAME,SIZE,FSTYPE,LABEL /dev/nbd0
After mounting the EFI partition (vfat) and editing grub.cfg, I disconnected it and registered the image again.
qemu-nbd --disconnect /dev/nbd0
openstack image delete cirros
openstack image create --disk-format qcow2 --container-format bare --public --file /root/cirros-nomsi.img cirros
After switching to this image, the login prompt appeared within 60 seconds. The mycirros uploaded from the dashboard is the same file.
Problem 3. docker and dbus Modules Missing in prechecks
prechecks failed at the import docker and import dbus checks. Kolla-Ansible handles Docker and systemd with the virtual environment's Python, and the virtual environment didn't have the two packages. dbus-python needs to be built, so I installed the header packages first.
apt-get install -y libdbus-1-dev libglib2.0-dev pkg-config
pip install docker dbus-python
Problem 4. Dashboard Image Upload Blocked by CORS
When uploading mycirros from the dashboard, the browser sends the file directly to glance, and that request was blocked by CORS. Connecting from the Mac through an SSH tunnel made the origin http://localhost:8080, while glance only allowed the origin http://192.168.64.4. I added the tunnel address to allowed_origin in glance.conf and reconfigured glance only (34 seconds).
kolla-ansible reconfigure -i ./all-in-one -t glance
Problem 5. Empty VNC Console
The dashboard "Console" tab only showed "Display output is not active". This is because aarch64 cirros outputs to the serial port, not the display (VGA). In the dashboard I viewed the serial output in the "Log" tab, and used virsh console for console input.
6. Linux Container Networking
I cloned the Rocky Linux 10 VM to create lxc.cloud.org and followed the network namespace lab in slide Ch15 (pages 29–75) to build the setup in the p67 figure. It puts a bridge br0 (10.0.100.1) in the root network namespace, attaches namespaces netns1·netns2 with veth, and sends traffic out through NAT.
Root network namespace (lxc.cloud.org)
enp1s0 192.168.122.16 ── NAT(masquerade) ── external
br0 10.0.100.1 ─┬─ brif1 ⇄ veth1 10.0.100.101 [netns1]
└─ brif2 ⇄ veth2 10.0.100.102 [netns2]
Creating a Network Namespace

Root network namespace interfaces of the cloned VM lxc.cloud.org (Rocky Linux 10.2). lo, enp1s0, enp2s0
ip netns add netns1
ip netns exec netns1 ip link
ip netns exec netns1 ping -c 2 127.0.0.1
ip netns exec netns1 ip link set dev lo up

ip netns add netns1. The new namespace has only lo, which is down, so even 127.0.0.1 is unreachable

ping to 127.0.0.1 succeeds after bringing up lo in netns1
Running nginx inside the namespace shows that only the network is separated.
dnf install -y nginx
curl 127.0.0.1
ip netns exec netns1 curl 127.0.0.1
ip netns exec netns1 nginx
ps -ef | grep nginx
ss -nat | grep LISTEN
ip netns exec netns1 ss -nat | grep LISTEN

Adding the nginx repository and installing it. Before it runs, connections to port 80 fail in both root and netns1

Running nginx inside netns1. The process is visible from root too (the PID namespace is shared), but the response and LISTEN 0.0.0.0:80 exist only in netns1
Connecting Namespaces with veth
ip link add veth1 type veth peer name veth2
ip link set veth1 netns netns1
ip a add 10.0.100.2/24 dev veth2
ip netns exec netns1 ip a add 10.0.100.1/24 dev veth1
ip link set dev veth2 up
ip netns exec netns1 ip link set dev veth1 up
ping -c 2 10.0.100.1

Creating a veth pair (veth1–veth2), moving veth1 to netns1 and assigning 10.0.100.1/10.0.100.2

After bringing up both ends, ping between root ↔ netns1 succeeds
ip netns add netns2
ip link set veth2 netns netns2
ip netns exec netns2 ip a add 10.0.100.2/24 dev veth2
ip netns exec netns2 ip link set dev veth2 up
ip netns exec netns1 ping -c 2 10.0.100.2

Moving veth2 to a new namespace netns2 and assigning the address again. ping between netns1 ↔ netns2 succeeds
Connecting Through a Bridge
A veth pair only connects two ends. When there are more namespaces, a bridge goes in the root and the opposite end (brif) of each namespace's veth is plugged into the bridge.
ip netns exec netns1 ip link delete veth1
ip link add br0 type bridge
ip link set br0 up
ip link add brif1 type veth peer name veth1
ip link add brif2 type veth peer name veth2
ip link set veth1 netns netns1
ip link set veth2 netns netns2
ip netns exec netns1 ip a add 10.0.100.101/24 dev veth1
ip netns exec netns2 ip a add 10.0.100.102/24 dev veth2
ip netns exec netns1 ip link set dev veth1 up
ip netns exec netns2 ip link set dev veth2 up

Deleting the old veth, creating and bringing up bridge br0, creating veth pairs brif1–veth1 and brif2–veth2

Moving veth1·veth2 into their namespaces and assigning 10.0.100.101/102. The opposite brif ends are down, so LOWERLAYERDOWN
ip link set brif1 master br0
ip link set brif2 master br0
ip link set dev brif1 up
ip link set dev brif2 up
ip netns exec netns1 ping -c 2 10.0.100.102

Attaching brif1·brif2 to br0 and bringing them up. veth1·veth2 change to UP

ping between netns1 ↔ netns2 through br0 succeeds
Connecting to the Root Network Namespace
In this state, only the namespaces can reach each other. There is no route to the root or outside.

From root, external (8.8.8.8) traffic works, but netns1·netns2 get Network is unreachable

Root → 10.0.100.101/102 and netns → root (enp1s0 192.168.122.16) both fail
Giving br0 an address in the same range creates a 10.0.100.0/24 → br0 route in the root routing table, so root → netns works. For the opposite direction, each namespace needs a route to the root's range (192.168.122.0/24).
ip addr add 10.0.100.1/24 brd 10.0.100.255 dev br0
ping -c 2 10.0.100.101
ip netns exec netns1 route add -net 192.168.122.0 netmask 255.255.255.0 dev veth1
ip netns exec netns2 route add -net 192.168.122.0 netmask 255.255.255.0 dev veth2
ip netns exec netns1 ping -c 2 192.168.122.16

Checking the routing table and assigning 10.0.100.1/24 to br0. A route sending 10.0.100.0/24 to br0 is added

ping from root → br0 (10.0.100.1), netns1 (.101), netns2 (.102) succeeds

netns → root still fails. Adding a 192.168.122.0/24 route to netns1 (corresponds to 10.0.2.0/24 in the slides)

Adding the same route to netns2

ping from netns1·netns2 → root (192.168.122.16) succeeds, external (8.8.8.8) still unreachable
External Access with NAT
Going outside needs three more things: a default route in the namespaces pointing to br0, IP forwarding in the root, and masquerade that rewrites the 10.0.100.0/24 source to the enp1s0 address.
ip netns exec netns1 ip route add default via 10.0.100.1
ip netns exec netns2 ip route add default via 10.0.100.1
sysctl -w net.ipv4.ip_forward=1
firewall-cmd --permanent --zone=public --add-masquerade
firewall-cmd --permanent --zone=public --add-rich-rule='rule family="ipv4" source address="10.0.100.0/24" masquerade'
firewall-cmd --reload
ip netns exec netns1 ping -c 2 8.8.8.8

Checking the root's default gateway (192.168.122.1, enp1s0); netns1·netns2 have no default route

Adding default via 10.0.100.1 (br0) to netns1·netns2

Enabling IP forwarding, adding masquerade and a masquerade rule for the 10.0.100.0/24 source to firewalld, then reload

ping from netns1·netns2 → 8.8.8.8 succeeds
Traffic goes out by IP, but name resolution doesn't work. ip netns exec overlays the files in /etc/netns/<name>/ on top of that namespace's /etc, so putting a resolv.conf there is enough.
mkdir -p /etc/netns/netns1 /etc/netns/netns2
echo 'nameserver 8.8.8.8' > /etc/netns/netns1/resolv.conf
echo 'nameserver 8.8.8.8' > /etc/netns/netns2/resolv.conf
ip netns exec netns1 ping -c 2 google.com

ping to google.com fails because names don't resolve → nameserver 8.8.8.8 set in /etc/netns/netns1·netns2/resolv.conf

ping from netns1·netns2 → google.com succeeds. The p67 setup is complete
7. Exercises
Ch13-5. OpenStack Services and Their Roles
The OpenStack deployed above has 7 services registered in openstack service list. The dashboard (horizon) is a web UI with no API endpoint, so it is not in the list, but it was deployed and used alongside them.
| Service (project) | Type | Role |
|---|---|---|
| keystone | identity | Authentication and authorization. Manages users, projects and roles, issues tokens, and provides the list of the other services' API addresses (the service catalog). Every request has its keystone token checked. |
| nova | compute | Creating, starting, stopping and deleting instances. The scheduler picks the compute node to place an instance on, and nova controls the compute node's hypervisor (in this lab, KVM in the nova_libvirt container). |
| glance | image | VM image store. Registers and keeps disk images such as cirros and mycirros, and hands images to nova when instances are created. |
| neutron | network | Virtual networking. Creates networks, subnets, routers, ports, security groups and floating IPs, and connects instances to demo-net and the external network public1 with Open vSwitch. |
| placement | placement | Resource inventory. Records the total and used vCPU, memory and disk of each compute node, and provides candidates when the nova scheduler looks for a node with enough resources left for a flavor. |
| heat | orchestration | Orchestration. When a set of resources (a stack) such as servers, networks and volumes is declared in a HOT template (YAML), it creates, changes and deletes them in the right order. |
| heat-cfn | cloudformation | heat's AWS CloudFormation-compatible API. Accepts CloudFormation-format templates and requests from the cfn tools inside instances. |
| horizon | (dashboard) | Web dashboard. Calls the APIs of the services above so tasks such as registering images and creating instances can be done from a browser. |
Besides these, MariaDB (each service's database), RabbitMQ (the message queue between nova's and neutron's internal components) and Memcached (token cache) are not OpenStack services but shared infrastructure components the services use.
Ch14-3. A Case Where a Container-Based Service Is More Efficient
I chose Spotify's move to Kubernetes as the case. Spotify ran its containers with Helios, an orchestration tool it built in-house, and then moved to Kubernetes. According to the CNCF case study, after the move Kubernetes' bin-packing and multi-tenancy raised CPU utilization 2–3 times on average, and the time to create a new service and get capacity ready for deployment dropped from nearly an hour to seconds or minutes. Doing the same thing with VMs would mean starting a full OS for every service, which would not reach this density and speed.
There are four reasons container-based services are better.
- Density (resource efficiency): Containers share the host kernel and only isolate (namespaces) and limit (cgroups) at the process level, so unlike VMs they don't keep a separate guest OS kernel, memory and boot disk per service. More services can therefore be packed tightly onto one node (bin-packing), and Spotify's 2–3× CPU utilization improvement is this effect.
- Performance overhead: Felter et al. (2015) at IBM Research compared KVM VMs and Docker containers on the same hardware and reported that containers performed equal to or better than VMs in almost every measurement. This is because VM I/O goes through the hypervisor one more time, and they added that both need tuning for I/O-intensive workloads.
- Startup time and deployment speed: Containers start processes without booting an OS, so they start in seconds. Services with hundreds of microservices deploy, scale and roll back often, and this speed led to Spotify's shorter service creation time.
- Portability and consistency: The application and its libraries are bundled into one image, and the same image is used in development, testing and production. Images are smaller than VM images, so they are easier to pull from a registry and to version.
However, containers share the kernel, so their isolation is weaker than VMs. When mutually untrusted users share one host or a different OS kernel is needed, VMs are better, which is why running containers on top of VMs is common in practice.
References
- CNCF, "Spotify Case Study," 2019. https://www.cncf.io/case-studies/spotify/
- W. Felter, A. Ferreira, R. Rajamony, J. Rubio, "An Updated Performance Comparison of Virtual Machines and Linux Containers," IEEE ISPASS 2015, pp. 171–172.
Ch15-9. Building the Network Setup in Figure 15.12
I attached a third namespace, netns3, in the same way to the setup built in section 6 (br0 + netns1·netns2 + NAT).
ip netns add netns3
ip link add brif3 type veth peer name veth3
ip link set veth3 netns netns3
ip netns exec netns3 ip a add 10.0.100.103/24 dev veth3
ip netns exec netns3 ip link set dev veth3 up
ip link set brif3 master br0
ip link set dev brif3 up
ip netns exec netns3 ip route add 192.168.122.0/24 dev veth3
ip netns exec netns3 ip route add default via 10.0.100.1
mkdir -p /etc/netns/netns3; echo 'nameserver 8.8.8.8' > /etc/netns/netns3/resolv.conf

Namespaces netns1·netns2·netns3 and brif1·brif2·brif3 attached to br0

netns3 setup. veth3 10.0.100.103/24 UP, default via 10.0.100.1
I checked the four cases at once with a loop.
for s in 1 2 3; do for d in 101 102 103; do [ $d = 10$s ] && continue
echo -n "netns$s -> 10.0.100.$d : "
ip netns exec netns$s ping -c 2 -W 2 -q 10.0.100.$d | grep -o '[0-9]* received'
done; done

(a) ping in all 6 directions between netns1·netns2·netns3, all 2 received

(b) each netns → root (192.168.122.16), (c) root → each netns, all 2 received

(d) netns1·netns2·netns3 → google.com, all 0% packet loss
All four cases work. Namespaces on the same bridge are forwarded at L2 by br0, and root ↔ netns works because br0's 10.0.100.1 is in the same range. netns → external works because the root IP-forwards packets that reach br0 through the default route, and firewalld masquerade rewrites the source address to the enp1s0 address before sending them out.