Skip to content

Instantly share code, notes, and snippets.

View williamcaban's full-sized avatar

William Caban Babilonia williamcaban

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
williamcaban / Simulating Bare Metal with
Last active May 30, 2024 11:39
Bare Metal IPMI for VMs with Virtual BMC

Simulate Bare-Metal IPMI for VMs in RHEL8 Libvirt

  • Install the Virtual BMC package in the machine to use as the vBMC server. Note1: When using OpenStack repos the python3-virtualbmc RPM might be available. These instrucctions do not use that package.
    pip3 install virtualbmc
    • The vBMC server can be running in any machine. When using a remote libvirt server it is recommended to have passwordless authentication from the vBMC server to the libvirt machines.
    • For this document the vBMC Server export vBMCServerIP=

Using Sushy Tools with Libvirt

  • Add linux user to libvirt group
sudo usermod -a -G libvirt <your-user>
sudo -y install libvirt-devel gcc python3-devel
  • Login and validate user can execute virsh commands
williamcaban / api-access-from-jumphost.yaml
Last active April 5, 2024 01:17
Example of limiting the access to OpenShift control-plane, Kube API and SSH to control plane nodes using the Ingress Node Firewall Operator
kind: IngressNodeFirewallConfig
name: ingressnodefirewallconfig
namespace: openshift-ingress-node-firewall
nodeSelector: ""
williamcaban / Export RHV to
Last active January 11, 2024 11:06
Customizing and Expanding QCOW2 Images

Export RHV/Ovirt VM to qcow2 format

  1. Configure export domain in RHV or Ovirt

  2. Export the VM to the export domain. A new directory with the vdisk uuid will be created and the VM will be exported to it.

    • A sample export /exportfs/export_domain/<vdisk_uuid>/images/<disk_id>
  3. Mount the export domain ito a Linux mcahine and go into the <vdisk_uuid>/images

  4. In the folder there iwll be a file with a uuid representing the <disk_id> and a meta file

  5. Use qemu-img convert to convert to qcow2 format

set -euoE pipefail
# Redfish commands related to Virtual Media.
# Redfish doc reference:
export BMC_ADDRESS=''
export ISO_IMAGE=
export username_password='Administrator:superuser'

Troubleshooting CPU isolation

  • Identifying cores assigned to a particular container
ID=$(crictl ps --label<name-of-container> -o json | jq -r '.containers[0].id')
PID=$(crictl inspect $ID | jq -r '')
taskset -pc $PID 


williamcaban /
Created September 17, 2021 12:34
Script to test latency and speed towards OpenShift Kubernetes API Server
# If $USERNAME and $PASSWORD are not defined
# in the environment prompt for them
if [ -z "${USERNAME+x}" ]; then
read -p 'Username: ' USERNAME
if [ -z "${PASSWORD+x}" ]; then
read -sp 'Password: ' PASSWORD
echo -e "\nAttempting to find the K8s API Server and token"
williamcaban / NetFlow or SFlow with OpenShift
Created May 2, 2020 15:24
Simple procedure to enable NetFlow or SFlow on OpenShift 4

Netflow or sFlow on OpenShift 4 w/OVN Kubernetes

  • Identify the ovs-node of the Node hosting the Pods to monitor

    # oc get pods --selector="app=ovs-node" -o wide
    ovs-node-4hldj   1/1     Running   0          47h   worker-1   <none>           <none>

ovs-node-bd9ln 1/1 Running 0 47h master-1

williamcaban /
Created August 2, 2020 22:22
Using client/server iperf pods

Using iperf Pods

  • Create namespace or project for running iperf tests:
oc new-project iperf-test
  • Create server Pod
rm -f pod-iperf-server.yaml