Skip to content

Instantly share code, notes, and snippets.

View SMAK1993's full-sized avatar

Syed Mohammad Adnan Karim SMAK1993

View GitHub Profile
@SMAK1993
SMAK1993 / maas-set-boot-disk.sh
Last active April 18, 2020 15:20
Script to set the boot device on all machines in MAAS
#!/bin/bash
tagName=foundation-nodes
diskName="os$"
machines=$(maas root tag machines $tagName | jq -r '.[] | .system_id')
for machine in $machines
do
diskId=$(maas root block-devices read $machine | jq -r '.[] | .name, .id' | grep $diskName -A 1 | tail -n 1)
echo "maas root block-device set-boot-disk $machine $diskId"
@SMAK1993
SMAK1993 / o7k-volume-and-instance-migration.sh
Last active November 3, 2024 09:50
Script for transferring VMs from one Openstack project to another
#!/bin/bash
# Requires Bash version 4+ because it uses dictionaries/arrays
# Define the 2 project IDs
# I assume the same user has access to both projects
OLD_PROJECT=INSERT_OLD_PROJECT_ID;
NEW_PROJECT=INSERT_NEW_PROJECT_ID;
# Maintain a dictionary of volume IDs to VM names so that we can attach to the correct VM later
# Detach the non-boot volumes from the VMs in the old project and transfer them to the new project
@SMAK1993
SMAK1993 / bundle.yaml
Created December 29, 2020 01:58
three-node-cdk-ceph-hyper-converged
description: A highly-available, production-grade Kubernetes cluster.
series: focal
machines:
# Baremetals
"1001":
constraints: tags=baremetal
"1002":
constraints: tags=baremetal
"1003":
constraints: tags=baremetal