Open vSwitch (OVS)

ovs-vsctl -- --may-exist add-port br-int o-hm0 -- \
set Interface o-hm0 type=internal -- \
set Interface o-hm0 external-ids:iface-status=active -- \
set Interface o-hm0 external-ids:attached-mac=${CTL_HOST_MAC} -- \
set Interface o-hm0 external-ids:iface-id=${PORT_ID} -- \
set Interface o-hm0 external-ids:skip_cleanup=true

ovs-vsctl -- del-port br-int o-hm0

Create port
openvswitch_vswitchd ovs-vsctl -- --may-exist add-port br-int my-port1 -- \
set Interface o-hm0 type=internal -- \

OpenStack: Glance (Image)

Deaktivate image
IMAGE_NAME="Ubuntu 14.04"
openstack image list --status active --name "${IMAGE_NAME}" -c ID -f value | xargs openstack image set --deactivate --private
openstack image list --status active

List the images
openstack image list

Delete all images
for IMAGE in $(openstack image list -c ID -f value); do
openstack image set --unprotected ${IMAGE}
openstack image delete ${IMAGE}

Delete image
IMAGE_NAME="Ubuntu 16.04"
openstack image set --unprotected ${IMAGE_NAME}

OpenStack: Live migrate VM to another OpenStack hypervisor


# list all vms on a hypervisor
openstack server list --all --status ACTIVE --host

# get current hypervisor
openstack server show ${VM} -c OS-EXT-SRV-ATTR:host -f value

# list avaiable hypervisors
openstack host list -c "Host Name" -c Service -f value | grep compute | cut -d" " -f1

# migrate VM
openstack server migrate ${VM} --live ${TARGET_COMPUTE_NODE} --wait

# get state
openstack server show ${VM} -c name -c OS-EXT-SRV-ATTR:host -c status -f value | paste - - -

# migrate all VMs
openstack server list --all --host ${OS_NODE}

Ansible Redfish module

# redfish_facts module
local: /usr/lib/python2.7/dist-packages/ansible/modules/remote_management/redfish/

# redfish_utils library
local: /usr/lib/python2.7/dist-packages/ansible/module_utils/

#!/usr/bin/env ansible-playbook

- hosts: localhost

Migrate LXC container to LXD (with ZFS storage)


lxc-stop -n ${CONTAINER_NAME}
lxc init ubuntu:18.04 ${CONTAINER_NAME} -c security.privileged=true -c boot.autostart=true
#lxc stop ${CONTAINER_NAME}
#lxc config set ${CONTAINER_NAME} boot.autostart true
zfs mount tank/lxd/containers/${CONTAINER_NAME}
mv /var/lib/lxd/containers/${CONTAINER_NAME}/rootfs{,.org}
rsync -av --numeric-ids /var/lib/lxc/${CONTAINER_NAME}/rootfs /var/lib/lxd/containers/${CONTAINER_NAME}/
mv /var/lib/lxd/containers/${CONTAINER_NAME}/rootfs/dev{,.org}

OpenStack: Octavia LoadBalancer (LBaaS)

Create Amphora image
sudo apt install -y python-pip git qemu qemu-utils debootstrap kpartx
sudo pip install diskimage-builder
git clone
cd octavia
sudo ./diskimage-create/ -d bionic -t raw
chmod a+r ./amphora-x64-haproxy.raw

Upload Amphora image
#openstack image create --container-format bare --disk-format qcow2 --private --file amphora-x64-haproxy.qcow2 --tag amphora amphora

iLO - IPMI on HP servers

Download Latest firmware
# download "RECOMMENDED * Online ROM Flash Component for Linux - HPE Integrated Lights-Out"

Extract firmware
chmod +x /tmp/CP0*.scexe
/tmp/CP0*.scexe --unpack=/tmp

# flash iLo firmware (local)
yes | ./CP036949.scexe

# ipmitool -I lanplus -H www1-ipmi -U Administrator -P pass1234 hpm upgrade ilo4_261.bin

Flash iLo with SSH (not tested)

Nginx (proxy) Docker container

Create required directories
mkdir -p /etc/docker/nginx/{conf.d,html}

Configure nginx as webserver
cat < /etc/docker/nginx/conf.d/default.conf
server {
listen 80;
server_name _;

root /usr/share/nginx/html;
index index.html index.htm;

Configure nginx as proxy
cat < /etc/docker/nginx/conf.d/proxy.conf
server {
listen 80;

location / {
proxy_pass http://localhost:8080/;

Create container