From 9e600c4eb03a8120e1e22dbc0379b2e7f9941db5 Mon Sep 17 00:00:00 2001 From: Nicholas Kuechler Date: Mon, 28 Oct 2024 13:50:00 -0500 Subject: [PATCH] docs: adds additional openstack docs --- docs/user-guide/openstack-ironic.md | 67 ++++++++++++++++++++++++++ docs/user-guide/openstack-placement.md | 17 +++++++ 2 files changed, 84 insertions(+) create mode 100644 docs/user-guide/openstack-ironic.md create mode 100644 docs/user-guide/openstack-placement.md diff --git a/docs/user-guide/openstack-ironic.md b/docs/user-guide/openstack-ironic.md new file mode 100644 index 000000000..4e01cb91a --- /dev/null +++ b/docs/user-guide/openstack-ironic.md @@ -0,0 +1,67 @@ +# OpenStack Baremetal (Ironic) + +## Setting baremetal node flavor + +Upstream docs: + +When creating a flavor, make sure to include a property for the baremetal custom flavor, +which in this example is `resources:CUSTOM_BAREMETAL_GP2SMALL=1`: + +``` +openstack --os-cloud understack flavor create \ + --ram 98304 --disk 445 --vcpus 32 --public \ + --property resources:CUSTOM_BAREMETAL_GP2SMALL=1 \ + --property resources:DISK_GB=0 \ + --property resources:MEMORY_MB=0 \ + --property resources:VCPU=0 gp2.small +``` + +Then set the baremetal node's resource class with the custom flavor: + +``` +openstack baremetal node set 8d15b1b4-e3d8-46c3-bcaa-5c50cd5d1f5b --resource-class baremetal.gp2small +``` + +## Cleaning a baremetal node + +Create a baremetal raid config file for a raid1 config with the following contents: + +``` json title="raid1-config.json" +{ "logical_disks": + [ { "controller": "RAID.SL.1-1", + "is_root_volume": true, + "physical_disks": [ + "Disk.Bay.0:Enclosure.Internal.0-1:RAID.SL.1-1", + "Disk.Bay.1:Enclosure.Internal.0-1:RAID.SL.1-1" + ], + "raid_level": "1", + "size_gb": "MAX" + } + ] +} +``` + +Apply the raid1 config from above: + +``` bash +openstack --os-cloud=${OS_CLOUD} baremetal node set ${NODE_UUID} --target-raid-config raid1-config.json +``` + +Create another file with our node cleaning steps: + +``` json title="raid-clean-steps.json" +[{ + "interface": "raid", + "step": "delete_configuration" +}, +{ + "interface": "raid", + "step": "create_configuration" +}] +``` + +Clean the node: + +``` +openstack --os-cloud=${OS_CLOUD} baremetal node clean --clean-steps raid-clean-steps.json --disable-ramdisk ${NODE_UUID} +``` diff --git a/docs/user-guide/openstack-placement.md b/docs/user-guide/openstack-placement.md new file mode 100644 index 000000000..b70515b9e --- /dev/null +++ b/docs/user-guide/openstack-placement.md @@ -0,0 +1,17 @@ +# OpenStack Placement + +## Query Placement usages + +Get an openstack token: + +``` +TOKEN=`openstack token issue -f json | jq -r '.id'` +``` + +Make sure to change the placement url to your own environment: + +``` +curl -H "X-Auth-Token: $TOKEN" \ + -k \ + 'https://placement.understack/resource_providers/2ce4ba74-3dad-4b6e-baf1-3df26e93875f/usages' | jq +```