Deploy OpenStack host with Ironic and Redfish

Define node variables


Define env variables


Create now node with Redfish (pxe device boot broken)

openstack baremetal node create \
  --name ${NODE} \
  --driver redfish \
  --driver-info redfish_address="https://${NODE_BMC_HOST}" \
  --driver-info redfish_username=${NODE_BMC_USER} \
  --driver-info redfish_password=${NODE_BMC_PASS} \
  --driver-info redfish_verify_ca=false \
  --driver-info redfish_system_id=/redfish/v1/Systems/1

Create now node with IPMI

openstack baremetal node create \
  --name ${NODE} \
  --driver ipmi \
  --driver-info ipmi_address=${NODE_BMC_HOST} \
  --driver-info ipmi_username=${NODE_BMC_USER} \
  --driver-info ipmi_password=${NODE_BMC_PASS} 



Ansible galaxy

ansible-galaxy install <REPOSITORY>
ansible-galaxy role install  --roles-path /tmp
mv /tmp/1.2.0 ~/.ansible/roles/avanov.pyenv - Network configuration

Linux software RAID (mdadm)

ansible-galaxy install mrlesmithjr.mdadm

Ubuntu multipass

# install  multipass
sudo snap install multipass --edge --classic
snap info multipass
multipass version
# create VM
multipass launch --name vm1
multipass launch --name vm5 --disk 4G --mem 256M core18
multipass exec vm3 -- lsb_release -a
multipass mount /tmp/mp vm3
multipass transfer /etc/fstab vm3:/tmp/y
multipass exec vm3 -- sudo apt update && sudo apt dist-upgrade -y

SSH login to VM

sudo ssh ubuntu@<VM_IP> -i /var/snap/multipass/common/data/multipassd/ssh-keys/id_rsa
multipass delete vm2
multipass purge 
sudo multipass set local.driver=libvirt


Check OpenvSwitch

export OS_ENV="@globals.environment@"
if [ "${OS_ENV}" == "dev" ]; then
    export PYENV_ROOT="$HOME/.pyenv"
    export PATH="$PYENV_ROOT/bin:$PATH"
    eval "$(pyenv init -)"
source /etc/kolla/
# search for broken ovs entry in DB
for NODE in $(openstack compute service list -c Host -f value | sort -u); do
    OUTPUT=$(ssh ${NODE} docker exec openvswitch_vswitchd ovsdb-client dump | grep qvo | egrep -v "tag|mac" | cut -d "\"" -f2)
    for PORT in ${OUTPUT}; do
        printf "%-20s %s\n" "${NODE}" "${PORT}"

Check server

source /etc/kolla/
# search for server with status ERROR
OUTPUT="$(openstack server list --all --status=ERROR -c ID -c Name -c Status -f value)"
#openstack server show ${SERVER_ID} -c fault -f value
if [ -n "${OUTPUT}" ]; then
    echo "${OUTPUT}"
# search for server with status VERIFY_RESIZE
OUTPUT="$(openstack server list --all --status=VERIFY_RESIZE -c ID -c Name -c Status -f value)"
if [ -n "${OUTPUT}" ]; then
    echo "${OUTPUT}"
# search for server processes on wrong compute node
for COMPUTE_NODE in $(openstack compute service list --service nova-compute -c Host -f value); do
    for SERVER_ID in $(ssh ${COMPUTE_NODE} pgrep qemu -a | grep -o -P '(?<=-uuid ).*(?= -smbios)'); do

OpenStack: placement (resource provider)

Install CLI client

pip install openstack-placement
echo 3.5.6 > .python-version

resource provider allocation

RESOURCE_PROVIDER_ID=$(openstack resource provider list --name ${NODE_NAME}.$(hostname -d) -c uuid -f value)
openstack resource provider show --allocations ${RESOURCE_PROVIDER_ID} -c allocations -f json
# list hypervisor
openstack resource provider list --sort-column name
# show
openstack resource provider allocation show ${SERVER_ID}

Add resource provider to aggregate

#Add compute node to AZ
openstack aggregate add host az1-aggregate comX-prod
# get resource provider ID
RESOURCE_PROVIDER_ID=$(openstack --os-placement-api-version=1.2 resource provider show XXXXXX-XXXX-XXXX-XXXX-XXXXXX -c uuid -f value)
# get aggregate ID
AGGREGATE_ID=$(openstack --os-compute-api-version=2.53 aggregate show XXX -c uuid -f value)
# Add resource provider to that aggregate
openstack --os-placement-api-version=1.2 resource provider aggregate set --aggregate ${AGGREGATE_ID} ${RESOURCE_PROVIDER_ID}

Check multiple / broken resource provider allocation

qemu guest agent

OpenStack admin

openstack image set --property hw_qemu_guest_agent=yes ${IMAGE_ID}

Within the VM

# check whather hw_qemu_guest_agent is enabled
ls -l /dev/virtio-ports/org.qemu.guest_agent.0
# install qemu-guest-agent
sudo apt-get install -y qemu-guest-agent


docker exec -ti nova_libvirt virsh qemu-agent-command instance-000069d9 '{"execute":"guest-info"}'

Execute command

openstack server show d82ca1de-1fcd-4ca6-84db-84891ec37796 -c OS-EXT-SRV-ATTR:hypervisor_hostname -c OS-EXT-SRV-ATTR:instance_name
docker exec -ti nova_libvirt virsh qemu-agent-command instance-000069d9 '{"execute":"guest-network-get-interfaces"}'