Skip to content

WIP: Revive bikolla testing #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 18 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,7 @@ venv.bak/
# mypy
.mypy_cache/

sushy-venv
kolla-venv/
os-venv/
kolla-ansible/
20 changes: 20 additions & 0 deletions ansible.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[defaults]
forks = 20
# Use the YAML stdout callback plugin.
stdout_callback = yaml
# Use the stdout_callback when running ad-hoc commands.
bin_ansible_callbacks = True
# Disable fact variable injection to improve performance.
inject_facts_as_vars = False
# Add timing information to output
callbacks_enabled = ansible.posix.profile_tasks
# Silence warning about invalid characters found in group names
force_valid_group_names = ignore

[inventory]
# Fail when any inventory source cannot be parsed.
any_unparsed_is_failed = True

[ssh_connection]
pipelining = True
ssh_extra_args = -o ControlPersist=1h
19 changes: 19 additions & 0 deletions enroll-baremetal.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

# Enroll baremetal machine

set -e
python3 -m venv os-venv
source os-venv/bin/activate
pip install -U pip
pip install -U setuptools
pip install python-openstackclient python-ironicclient python-ironic-inspector-client

openstack baremetal node create \
--driver redfish \
--driver-info redfish_system_id=$1 \
--driver-info redfish_address="http://192.168.33.3:8000" \
--driver-info ipmi_address="http://192.168.33.3:8000" \
--name test-vm

openstack baremetal node manage test-vm
23 changes: 18 additions & 5 deletions etc/kolla/config/ironic.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
[DEFAULT]
enabled_hardware_types = ipmi
default_deploy_interface = direct
enabled_inspect_interfaces = no-inspect,inspector
default_inspect_interface = inspector
enabled_network_interfaces = noop
enabled_hardware_types = redfish
enabled_boot_interfaces = redfish-virtual-media,redfish-https
enabled_power_interfaces = redfish
enabled_management_interfaces = redfish
enabled_inspect_interfaces = agent,redfish
default_network_interface = noop
default_boot_interface = redfish-virtual-media

[conductor]
deploy_kernel = http://192.168.33.3:8089/ironic-agent.kernel
deploy_ramdisk = http://192.168.33.3:8089/ironic-agent.initramfs
bootloader = file:///var/lib/ironic/httpboot/esp.img

[neutron]
cleaning_network = none

[redfish]
kernel_append_params = nofb nomodeset vga=normal console=tty0 console=ttyS0,115200n8
9 changes: 7 additions & 2 deletions etc/kolla/globals.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
virtualenv: /home/centos/kolla-venv
virtualenv: "/home/{{ lookup('env', 'USER') }}/bikolla/kolla-venv"
kolla_user: "{{ lookup('env', 'USER') }}"
kolla_group: "{{ lookup('env', 'USER') }}"

Expand All @@ -20,9 +20,14 @@ enable_haproxy: "no"
enable_ironic: "yes"
enable_ironic_ipxe: "yes"
enable_memcached: "no"
enable_keystone: "yes"
enable_ironic_inspector: "no"

ironic_enable_keystone_integration: "yes"

# Set $DHCP_RANGE to a DHCP range for dnsmasq.
ironic_dnsmasq_dhcp_range: "{{ lookup('env', 'DHCP_RANGE') | default('192.168.1.3,192.168.1.254', true) }}"
ironic_dnsmasq_dhcp_ranges:
- range: "{{ lookup('env', 'DHCP_RANGE') | default('192.168.33.4,192.168.33.254', true) }}"

# Don't enable the inspector PXE filter since we're using the DHCP server for
# provisioning as well as inspection.
Expand Down
23 changes: 20 additions & 3 deletions etc/kolla/inventory/all-in-one
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@
[control]
localhost ansible_host=127.0.0.1

[common:children]
control

[cron:children]
common

[kolla-logs:children]
common

[kolla-toolbox:children]
common

[fluentd:children]
common

[baremetal:children]
control

Expand All @@ -15,6 +30,9 @@ control
[ironic:children]
control

[keystone:children]
control

# iSCSI
[iscsid:children]
ironic
Expand All @@ -27,12 +45,11 @@ ironic
ironic

[ironic-inspector:children]
ironic

[ironic-pxe:children]
[ironic-tftp:children]
ironic

[ironic-ipxe:children]
[ironic-http:children]
ironic

# Referenced but not required.
Expand Down
7 changes: 4 additions & 3 deletions kolla-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set -e

docker ps || (echo "Cannot communicate with docker engine. Have you logged out and back in?"; exit 1)
source kolla-venv/bin/activate
kolla-ansible -i /etc/kolla/inventory/all-in-one prechecks -e ansible_python_interpreter=/home/centos/kolla-venv/bin/python
kolla-ansible -i /etc/kolla/inventory/all-in-one pull -e ansible_python_interpreter=/home/centos/kolla-venv/bin/python
kolla-ansible -i /etc/kolla/inventory/all-in-one deploy -e ansible_python_interpreter=/home/centos/kolla-venv/bin/python
kolla-ansible -vv -i /etc/kolla/inventory/all-in-one prechecks -e ansible_python_interpreter=~/bikolla/kolla-venv/bin/python
kolla-ansible -vv -i /etc/kolla/inventory/all-in-one pull -e ansible_python_interpreter=~/bikolla/kolla-venv/bin/python
kolla-ansible -vv -i /etc/kolla/inventory/all-in-one deploy -e ansible_python_interpreter=~/bikolla/kolla-venv/bin/python
kolla-ansible -vv -i /etc/kolla/inventory/all-in-one post-deploy -e ansible_python_interpreter=~/bikolla/kolla-venv/bin/python
38 changes: 26 additions & 12 deletions kolla-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,56 @@

set -e

sudo yum -y install wget python-devel libffi-devel gcc openssl-devel libselinux-python python-virtualenv
if ! ip l show breth1 >/dev/null 2>&1; then
sudo ip l add breth1 type bridge
fi
sudo ip l set breth1 up
if ! ip a show breth1 | grep 192.168.33.3/24; then
sudo ip a add 192.168.33.3/24 dev breth1
fi
if ! ip l show dummy1 >/dev/null 2>&1; then
sudo ip l add dummy1 type dummy
fi
sudo ip l set dummy1 up
sudo ip l set dummy1 master breth1

sudo dnf -y install wget python-devel libffi-devel gcc openssl-devel dbus-devel dbus-glib-devel

if [[ ! -f ~/.ssh/id_rsa ]]; then
ssh-keygen -f ~/.ssh/id_rsa -t rsa -N ''
fi
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys

if [[ ! -d ./kolla-ansible ]]; then
git clone https://github.com/openstack/kolla-ansible
pushd kolla-ansible
git fetch https://git.openstack.org/openstack/kolla-ansible refs/changes/03/633503/1 && git cherry-pick FETCH_HEAD
popd
fi
virtualenv kolla-venv
if [[ ! -L kolla-venv/lib/python2.7/site-packages/selinux ]]; then
ln -s /usr/lib64/python2.7/site-packages/selinux/ kolla-venv/lib/python2.7/site-packages/
git clone https://github.com/openstack/kolla-ansible -b master
fi
python3 -m venv kolla-venv
source kolla-venv/bin/activate
pip install -U pip
pip install -U setuptools
pip install ./kolla-ansible
pip install ansible
pip install ansible docker dbus-python
ansible-galaxy install -r ./kolla-ansible/requirements.yml

sudo mkdir -p /etc/kolla
sudo chown $USER: -R /etc/kolla/
cp -r etc/kolla/* /etc/kolla/
mkdir -p /etc/kolla/config/ironic
wget -O /etc/kolla/config/ironic/ironic-agent.initramfs https://tarballs.openstack.org/ironic-python-agent/tinyipa/files/tinyipa-master.gz
wget -O /etc/kolla/config/ironic/ironic-agent.kernel https://tarballs.openstack.org/ironic-python-agent/tinyipa/files/tinyipa-master.vmlinuz

if [[ ! -e /etc/kolla/config/ironic/ironic-agent.initramfs ]]; then
wget -O /etc/kolla/config/ironic/ironic-agent.initramfs https://tarballs.openstack.org/ironic-python-agent/tinyipa/files/tinyipa-master.gz
fi
if [[ ! -e /etc/kolla/config/ironic/ironic-agent.kernel ]]; then
wget -O /etc/kolla/config/ironic/ironic-agent.kernel https://tarballs.openstack.org/ironic-python-agent/tinyipa/files/tinyipa-master.vmlinuz
fi

if [[ ! -e /etc/kolla/passwords.yml ]]; then
cp kolla-venv/share/kolla-ansible/etc_examples/kolla/passwords.yml /etc/kolla/
kolla-genpwd
fi
ssh-keyscan 127.0.0.1 >> ~/.ssh/known_hosts
kolla-ansible -i /etc/kolla/inventory/all-in-one bootstrap-servers
sudo usermod -aG docker $USER

if ! groups | grep docker >/dev/null; then
echo "Please log out then log back in to pick up Docker group membership"
Expand Down
26 changes: 26 additions & 0 deletions provision-overcloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
- name: Provision overcloud
hosts: localhost
tasks:
- openstack.cloud.baremetal_node_action:
name: "test-vm"
config_drive:
meta_data:
hostname: node1
public_keys:
default: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMzx+yurRSp1bDSae83+twZ8EdEiDg+tCzAMHSan0xdz kayobe@bikolla"
network_data:
links:
- id: port-8d850721-26a7-4886-950e-f2704179ba78
type: phy
ethernet_mac_address: 52:54:00:80:8b:fa
networks:
- id: network0
type: ipv4
link: port-8d850721-26a7-4886-950e-f2704179ba78
ip_address: "192.168.124.63"
netmask: "255.255.255.0"
network_id: network0
instance_info:
image_source: "https://cloud-images.ubuntu.com/noble/current/noble-server-cloudimg-amd64.img"
image_checksum: "071fceadf1ea57a388ff7a1ccb4127155d691a511f6a207b4c11b120563855e2"
image_disk_format: "qcow2"
29 changes: 29 additions & 0 deletions setup-virt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

# Setup virtual machine

set -e

sudo dnf config-manager --enable devel
sudo dnf -y install libvirt qemu-kvm libvirt-devel virt-install
python3 -m venv sushy-venv
pip install libvirt-python
source sushy-venv/bin/activate

sudo usermod -aG libvirt $USER
sudo systemctl enable --now virtqemud
sudo systemctl enable --now virtstoraged
sudo systemctl enable --now virtnetworkd

tmpfile=$(mktemp /tmp/sushy-domain.XXXXXX)
sudo virt-install \
--name vbmc-node \
--ram 1024 \
--disk size=20 \
--vcpus 2 \
--os-type linux \
--os-variant ubuntu24.04 \
--graphics vnc \
--print-xml > $tmpfile
sudo virsh define --file $tmpfile
rm $tmpfile
31 changes: 31 additions & 0 deletions sushy-legacy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash

# Redfish emulator dependencies setup

set -e

sudo dnf config-manager --enable devel
sudo dnf -y install libvirt qemu-kvm libvirt-devel virt-install
python3 -m venv sushy-venv
pip install libvirt-python sushy-tools
source sushy-venv/bin/activate

sudo usermod -aG libvirt $USER
sudo systemctl enable --now virtqemud
sudo systemctl enable --now virtstoraged
sudo systemctl enable --now virtnetworkd

tmpfile=$(mktemp /tmp/sushy-domain.XXXXXX)
sudo virt-install \
--name vbmc-node \
--ram 2048 \
--disk size=15 \
--vcpus 2 \
--os-type linux \
--os-variant ubuntu24.04 \
--graphics vnc \
--print-xml > $tmpfile
sudo virsh define --file $tmpfile
rm $tmpfile

sushy-emulator -i 192.168.33.3 --config ~/bikolla/sushy.conf
42 changes: 42 additions & 0 deletions sushy.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
SUSHY_EMULATOR_STORAGE = {
"f84aa5b8-b1ef-4478-81e8-0fe530a7fdde": [
{
"Id": "1",
"Name": "Local Storage Controller",
"StorageControllers": [
{
"MemberId": "0",
"Name": "Contoso Integrated RAID",
"SpeedGbps": 12
}
],
"Drives": [
"32ADF365C6C1B7BD"
]
}
]
}

SUSHY_EMULATOR_DRIVES = {
("f84aa5b8-b1ef-4478-81e8-0fe530a7fdde", "1"): [
{
"Id": "32ADF365C6C1B7BD",
"Name": "Drive Sample",
"CapacityBytes": 899527000000,
"Protocol": "SAS"
}
]
}

SUSHY_EMULATOR_VOLUMES = {
('f84aa5b8-b1ef-4478-81e8-0fe530a7fdde', '1'): [
{
"libvirtPoolName": "default",
"libvirtVolName": "vbmc-node-test3.qcow2",
"Id": "1",
"Name": "vbmc-node-volume",
"VolumeType": "File",
"CapacityBytes": 1073741824
}
]
}
11 changes: 11 additions & 0 deletions sushy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

# Redfish emulator dependencies setup

set -e

source ~/bikolla/sushy-venv/bin/activate
pip install sushy-tools

sushy-emulator -i 192.168.33.3 --config ~/bikolla/sushy.conf