Skip to content

Instantly share code, notes, and snippets.

View gibizer's full-sized avatar

Balazs Gibizer gibizer

View GitHub Profile
@gibizer
gibizer / tcib-commit-to-container-image.md
Last active December 19, 2023 10:37
Tcib commit hash to quay.oi container image

Deploy

User with sudo

This is only needed in a clean hypervisor. If you have a laptop with a user with sudo then you can skip the user creation and sudo setup. As root:

useradd -s /bin/bash -d /home/gibi -m gibi
echo "gibi ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/gibi
sudo -u gibi -i

Chapter 3. Configuring Compute nodes for performance

# (gibi): this chapter is good as is

3.1. Configuring CPU pinning on Compute nodes

# (gibi): mostly good. But the 3rd bullet point needs a reword as we don't have overcloud any more. I think we can even drop the 3rd bullet point

  1. Designate Compute nodes for CPU pinning.
  2. Configure the Compute nodes to reserve host cores for pinned instance vCPU processes, floating instance vCPU processes, and host processes.
// How to default a struct field?
// Example code: https://github.com/gibizer/simple-operator-example/commit/08fb63dda8aae4c20272b8e87d680228948e8ff6
// terminal #1
[fedora@gibi-f35 simple-operator-example]$ make run
test -s /home/fedora/op-build/simple-operator-example/bin/controller-gen || GOBIN=/home/fedora/op-build/simple-operator-example/bin go install sigs.k8s.io/controller-tools/cmd/controller-gen@v0.9.2
/home/fedora/op-build/simple-operator-example/bin/controller-gen rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
/home/fedora/op-build/simple-operator-example/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
go fmt ./...
import functools
import random
import time
import eventlet
from oslo_concurrency import lockutils
eventlet.monkey_patch()
LOCK = "my-lock"
import random
import time
import eventlet
from oslo_concurrency import lockutils
eventlet.monkey_patch()
LOCK = "my-lock"
@gibizer
gibizer / nested-pci-passthrough-with-libvirt.txt
Created May 27, 2022 14:16
Passing a PCI device from the host to L2 VM with libvirt
## host(with a real PCI dev) ---libvirt/qemu---> L1 VM (running devstack) ---nova/libvirt/qemu---> L2 VM
## host
# Enable iommu in the kernel
$ grep iommu /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="intel_iommu=on"
# the PCI device needs to be in a separate IOMMU group
# change placement conf
# [api]
# auh_strategy = noauth2
sudo apt install jq parallel --yes
sudo mysql -uroot -padmin -e "DROP DATABASE IF EXISTS placement;"
sudo mysql -uroot -padmin -e "CREATE DATABASE placement CHARACTER SET utf8;"
placement-manage db sync
sudo systemctl restart devstack@placement-*
INST=f996ef6b-4417-4eb3-aeb7-9f66d8c4d2c5
PORT=46ceed9e-1262-47c2-b7dc-335a31f78b71
rg \
"\
instance: $INST\] Unshelving|\
instance: $INST\] Swapping old allocation on .* held by migration .* for instance|\
instance: $INST\] Starting finish_revert_migration|\
Updating port $PORT with attributes|\
instance: $INST\] Preparing to wait for external event network-vif-plugged|\
# This will succeed if applied as an update over https://gist.github.com/gibizer/a0c4e5dc4a59ed3217f64c04a8f207a4
# if there are still free resource on the compute as neutron allows replacing a qos policy on a bound port and does
# the necessary allocation update in placement.
heat_template_version: wallaby
resources:
net0:
type: OS::Neutron::ProviderNet
properties:
name: net0