From 9218c272f0d126e5d0b3c8195f45903007c24d73 Mon Sep 17 00:00:00 2001 From: Christian Berendt Date: Sat, 16 Mar 2024 12:05:33 +0100 Subject: [PATCH] Prepare ironic deployment (pt. 2) Signed-off-by: Christian Berendt --- environments/kolla/configuration.yml | 20 ++++--- environments/kolla/files/overlays/ironic.conf | 16 +++++ .../openstack/playbook-bootstrap-edge.yml | 1 - .../openstack/playbook-bootstrap-sandbox.yml | 1 - inventory/group_vars/generic/kolla.yml | 2 + inventory/group_vars/generic/network.yml | 16 ++++- ironic.md | 60 +++++++++++++++++++ prepare-ironic.sh | 33 ++++++++++ 8 files changed, 137 insertions(+), 12 deletions(-) create mode 100644 environments/kolla/files/overlays/ironic.conf create mode 100644 ironic.md create mode 100755 prepare-ironic.sh diff --git a/environments/kolla/configuration.yml b/environments/kolla/configuration.yml index d6541ff..7fe2937 100644 --- a/environments/kolla/configuration.yml +++ b/environments/kolla/configuration.yml @@ -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" @@ -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 diff --git a/environments/kolla/files/overlays/ironic.conf b/environments/kolla/files/overlays/ironic.conf new file mode 100644 index 0000000..7dc4fc0 --- /dev/null +++ b/environments/kolla/files/overlays/ironic.conf @@ -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 diff --git a/environments/openstack/playbook-bootstrap-edge.yml b/environments/openstack/playbook-bootstrap-edge.yml index d3809f6..da468cf 100644 --- a/environments/openstack/playbook-bootstrap-edge.yml +++ b/environments/openstack/playbook-bootstrap-edge.yml @@ -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 diff --git a/environments/openstack/playbook-bootstrap-sandbox.yml b/environments/openstack/playbook-bootstrap-sandbox.yml index 5c0c30d..88a1a58 100644 --- a/environments/openstack/playbook-bootstrap-sandbox.yml +++ b/environments/openstack/playbook-bootstrap-sandbox.yml @@ -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 diff --git a/inventory/group_vars/generic/kolla.yml b/inventory/group_vars/generic/kolla.yml index 71ae673..8761596 100644 --- a/inventory/group_vars/generic/kolla.yml +++ b/inventory/group_vars/generic/kolla.yml @@ -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 }}" diff --git a/inventory/group_vars/generic/network.yml b/inventory/group_vars/generic/network.yml index da199fb..558bfe4 100644 --- a/inventory/group_vars/generic/network.yml +++ b/inventory/group_vars/generic/network.yml @@ -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 @@ -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 diff --git a/ironic.md b/ironic.md new file mode 100644 index 0000000..ae76e31 --- /dev/null +++ b/ironic.md @@ -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 diff --git a/prepare-ironic.sh b/prepare-ironic.sh new file mode 100755 index 0000000..fb69bcb --- /dev/null +++ b/prepare-ironic.sh @@ -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