Skip to content

Commit

Permalink
Prepare ironic deployment (pt. 2)
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Berendt <berendt@osism.tech>
  • Loading branch information
berendt committed Oct 10, 2024
1 parent 98a6f06 commit 9218c27
Show file tree
Hide file tree
Showing 8 changed files with 137 additions and 12 deletions.
20 changes: 13 additions & 7 deletions environments/kolla/configuration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,17 @@ openstack_service_workers: 2
libvirt_enable_sasl: "no"

# ironic
# ironic_dnsmasq_interface: "eno2"
# ironic_cleaning_network: "public"
# ironic_dnsmasq_dhcp_ranges:
# - range: "192.168.88.100,192.168.88.110"
# routers: "192.168.88.1"
ironic_cleaning_network: "public"

# No DNS is usable in the introspect network
ironic_inspector_internal_endpoint: https://192.168.16.254:5050
ironic_dnsmasq_dhcp_ranges:
- range: "192.168.17.100,192.168.17.110"
routers: "192.168.17.10"

# No trusted CA is used in the Cloud in a box
ironic_inspector_kernel_cmdline_extras:
- ipa-insecure=True

# octavia
octavia_loadbalancer_topology: "SINGLE"
Expand All @@ -47,8 +53,8 @@ neutron_plugin_agent: ovn
neutron_ovn_availability_zones:
- nova

# NOTE: Disable the debugging logs for Libvirt as Libvirt writes a lot of logs
# that are not of interest.
# We disable the debugging logs for Libvirt as Libvirt writes a lot of logs
# that are not of interest.
nova_libvirt_logging_debug: "no"

# nova
Expand Down
16 changes: 16 additions & 0 deletions environments/kolla/files/overlays/ironic.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[DEFAULT]

# DOCS: https://docs.openstack.org/ironic/latest/install/enabling-drivers.html
# ALL TYPES: https://opendev.org/openstack/ironic/src/branch/master/setup.cfg

enabled_hardware_types = ipmi,redfish
enabled_boot_interfaces = ipxe,redfish-virtual-media
enabled_console_interfaces = ipmitool-socat,no-console
enabled_deploy_interfaces = direct,ansible
enabled_inspect_interfaces = inspector,redfish,no-inspect
enabled_management_interfaces = ipmitool,redfish
enabled_network_interfaces = flat,neutron
enabled_power_interfaces = ipmitool,redfish
enabled_raid_interfaces = no-raid,redfish
enabled_storage_interfaces = cinder,noop
enabled_vendor_interfaces = ipmitool,no-vendor
1 change: 0 additions & 1 deletion environments/openstack/playbook-bootstrap-edge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
name: subnet-public
network_name: public
cidr: 192.168.112.0/24
enable_dhcp: false
allocation_pool_start: 192.168.112.100
allocation_pool_end: 192.168.112.200
gateway_ip: 192.168.112.10
Expand Down
1 change: 0 additions & 1 deletion environments/openstack/playbook-bootstrap-sandbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
name: subnet-public
network_name: public
cidr: 192.168.112.0/24
enable_dhcp: false
allocation_pool_start: 192.168.112.100
allocation_pool_end: 192.168.112.200
gateway_ip: 192.168.112.10
Expand Down
2 changes: 2 additions & 0 deletions inventory/group_vars/generic/kolla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
network_interface: "{{ network_internal_interface }}"
neutron_external_interface: "{{ network_workload_interface }}"
tunnel_interface: "{{ network_internal_interface }}"

ironic_dnsmasq_interface: "{{ network_metal_interface }}"
16 changes: 13 additions & 3 deletions inventory/group_vars/generic/network.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
---
##########################################################
# network
# The network_*_interface parameters are only used within the
# Cloud in a Box inventory for simplification.

network_internal_interface: vlan100
network_mgmt_interface: eno1

network_internal_interface: vlan100
network_workload_interface: vlan101
network_metal_interface: vlan102

##########################################################
# network

network_type: netplan

Expand All @@ -21,6 +26,11 @@ network_vlans:
vlan101:
id: 101
link: "{{ network_mgmt_interface }}"
vlan102:
id: 102
link: "{{ network_mgmt_interface }}"
addresses:
- "192.168.17.{{ node_id }}/24"

network_dispatcher_scripts:
- src: /opt/configuration/environments/manager/files/osism.sh
Expand Down
60 changes: 60 additions & 0 deletions ironic.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
cd /opt/openstackclient/data

wget https://tarballs.opendev.org/openstack/ironic-python-agent/dib/files/ipa-centos9-stable-2023.2.initramfs
wget https://tarballs.opendev.org/openstack/ironic-python-agent/dib/files/ipa-centos9-stable-2023.2.kernel

docker cp ipa-centos9-stable-2023.2.initramfs kolla-ansible:/share/ironic
docker cp ipa-centos9-stable-2023.2.kernel kolla-ansible:/share/ironic

cp ipa-centos9-stable-2023.2.initramfs /opt/configuration/environments/kolla/files/overlays/ironic/ironic-agent.initramfs
cp ipa-centos9-stable-2023.2.kernel /opt/configuration/environments/kolla/files/overlays/ironic/ironic-agent.kernel

osism apply ironic

openstack --os-cloud admin image create --disk-format aki --container-format aki --public \
--file /data/ipa-centos9-stable-2023.2.initramfs deploy-vmlinuz

openstack --os-cloud admin image create --disk-format ari --container-format ari --public \
--file /data/ipa-centos9-stable-2023.2.kernel deploy-initrd

openstack --os-cloud admin image show -f value -c id deploy-vmlinuz
openstack --os-cloud admin image show -f value -c id deploy-initrd

openstack --os-cloud admin flavor create my-baremetal-flavor \
--ram 32768 --disk 200 --vcpus 8 \
--property resources:CUSTOM_BAREMETAL_RESOURCE_CLASS=1 \
--property resources:VCPU=0 \
--property resources:MEMORY_MB=0 \
--property resources:DISK_GB=0

openstack --os-cloud admin baremetal node create --driver ipmi --name baremetal-node \
--driver-info ipmi_port=623 --driver-info ipmi_username=ADMIN \
--driver-info ipmi_password=ADMIN \
--driver-info ipmi_address=192.168.88.254 \
--resource-class baremetal-resource-class --property cpus=8 \
--property memory_mb=32768 --property local_gb=200 \
--property cpu_arch=x86_64 \
--driver-info deploy_kernel=4e268807-f381-4d98-8dd9-61ed5f2163cb \
--driver-info deploy_ramdisk=f6da7716-7765-4814-bd63-831c9fad2f1f

openstack --os-cloud admin baremetal node show baremetal-node -f value -c uuid

openstack --os-cloud admin baremetal port create 00:25:90:ba:b4:45 \
--node 403dfb04-8157-4ddb-a3a4-539b06612fee \
--physical-network physnet1

openstack --os-cloud admin baremetal port create 00:25:90:ba:b4:44 \
--node 403dfb04-8157-4ddb-a3a4-539b06612fee

openstack --os-cloud admin baremetal node power on 403dfb04-8157-4ddb-a3a4-539b06612fee
openstack --os-cloud admin baremetal node power off 403dfb04-8157-4ddb-a3a4-539b06612fee

openstack --os-cloud admin baremetal introspection start 403dfb04-8157-4ddb-a3a4-539b06612fee
openstack --os-cloud admin baremetal introspection status 403dfb04-8157-4ddb-a3a4-539b06612fee
openstack --os-cloud admin baremetal introspection abort 403dfb04-8157-4ddb-a3a4-539b06612fee

openstack --os-cloud admin baremetal node manage 403dfb04-8157-4ddb-a3a4-539b06612fee
openstack --os-cloud admin baremetal node provide 403dfb04-8157-4ddb-a3a4-539b06612fee

openstack --os-cloud admin server create --image "Cirros 0.6.2" --flavor my-baremetal-flavor \
--network public demo1
33 changes: 33 additions & 0 deletions prepare-ironic.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env bash

BASE_DIR="$(dirname $(readlink -f $0))"
source $BASE_DIR/include.sh

export INTERACTIVE=false

cd /opt/openstackclient/data

wget https://tarballs.opendev.org/openstack/ironic-python-agent/dib/files/ipa-centos9-stable-2023.2.initramfs
wget https://tarballs.opendev.org/openstack/ironic-python-agent/dib/files/ipa-centos9-stable-2023.2.kernel

docker cp ipa-centos9-stable-2023.2.initramfs kolla-ansible:/share/ironic
docker cp ipa-centos9-stable-2023.2.kernel kolla-ansible:/share/ironic

cp ipa-centos9-stable-2023.2.initramfs /opt/configuration/environments/kolla/files/overlays/ironic/ironic-agent.initramfs
cp ipa-centos9-stable-2023.2.kernel /opt/configuration/environments/kolla/files/overlays/ironic/ironic-agent.kernel

osism apply ironic

openstack --os-cloud admin image create \
--disk-format aki \
--container-format aki \
--public \
--file /data/ipa-centos9-stable-2023.2.initramfs \
deploy-vmlinuz

openstack --os-cloud admin image create \
--disk-format ari \
--container-format ari \
--public \
--file /data/ipa-centos9-stable-2023.2.kernel \
deploy-initrd

0 comments on commit 9218c27

Please sign in to comment.