Working with Openstack metadata service when using OVN

Metadata agent Running the agent neutron-ovn-metadata-agent –config-file /etc/neutron/neutron.conf –config-file /etc/neutron/neutron_ovn_metadata_agent.ini Configure neutron_ovn_metadata_agent.ini.j2 on the compute node(s) [ovn] ovn_nb_connection=tcp:{{OVN Controller IP}}:6641 ovn_sb_connection=tcp:{{OVN Controller IP}}:6642 ovn_metadata_enabled = true Configure neutron.conf on the Neutron server [ovn] ovn_metadata_enabled = true     Reading https://docs.openstack.org/networking-ovn/latest/admin/refarch/refarch.html – For a nice diagram on how the bits fit together https://man7.org/linux/man-pages/man7/ovn-architecture.7.html – Some more […]

Read More »

Swap space notes

Whats using swap space for file in /proc/*/status ; do awk ‘/VmSwap|Name/{printf $2 ” ” $3}END{ print “”}’ $file; done | sort -k 2 -n -r | less Who is eating all of my RAM? ps aux –sort=-%mem | head Where are my swap files cat /proc/swaps How to add more swap space 1. Create […]

Read More »

EasyRSA – Make a certificate and copy to ansible staging dir

I use this script on my CA server to create a certificate for each new server we provision. This allows our internal PKI to function. This script creates a certificate then copies it to the Ansible server where is can be deployed to the destination host Obviously you’ll need to take the necessary precautions around […]

Read More »

Ubuntu interfaces file examples

Example 1 – Includes some static routes and manually specified IP’s auto lo iface lo inet static address 103.90.59.9/32 auto ens3 iface ens3 inet static address 172.2.1.17 network 172.2.1.0 netmask 255.255.254.0 up route add -net 172.2.0.0 netmask 255.255.0.0 gw 172.2.1.1 up route add -net 172.2.0.0 netmask 255.255.0.0 gw 172.2.1.1 iface ens3 inet6 static address 2405:cc:ee:110::7 […]

Read More »

MYSQL Backup to S3 script

Script #!/bin/bash # Set the enviroment variable so read function knows to seperate on “,”. export IFS=”,” NOW=$(date +”%Y_%m_%d_%H_%M”) DATABASES_CONFIG_FILE=”/home/bfnadmin/databases.csv” S3_ENDPOINT=”https://my-s3-storage.com” S3_BUCKET=”s3://sql-backups” TEMP_BACKUP_DIR=”backups” while read HOST USERNAME PASSWORD DB_SRV DB_NAME; do echo “[$DB_SRV – $DB_NAME]” mysqldump –single-transaction –quick –lock-tables=false \ -h $HOST \ -u $USERNAME \ -p$PASSWORD \ $DB_NAME | gzip > $TEMP_BACKUP_DIR/$DB_SRV-$DB_NAME-$NOW.sql.gz echo “Uploading […]

Read More »

KVM\Qemu\Openstack – Manage a live migration

virsh qemu-monitor-command {VMNAME} –pretty ‘{“execute”:”migrate_cancel”}’ Allow Virsh more downtime(If it cant keepup with RAM utilization) virsh migrate-setmaxdowntime VMNAME 2500   Check migration status virsh domjobinfo instance-000002ac Job type: Unbounded Operation: Outgoing migration Time elapsed: 1307956 ms Data processed: 118.662 GiB Data remaining: 9.203 MiB Data total: 8.005 GiB Memory processed: 118.662 GiB Memory remaining: 9.203 […]

Read More »

Bonding in active-backup using linux bridges on Ubuntu 18

Because this was WAAYY more difficult to find any decent doco on that I had ever expected, here is what worked for me I deleted the netplan config file at /etc/netplan/01-netcfg.yaml rm /etc/netplan/01-netcfg.yaml Ensure that ‘bonding’ appears in /etc/modules (I’s not here by default) echo bonding >> /etc/modules   Here is /etc/network/interfaces source-directory /etc/network/interfaces.d auto […]

Read More »