### Install MariaDB Server (RHEL/CentOS/Fedora) Source: https://github.com/openstack/ironic/blob/master/doc/source/contributor/local-dev-guide.rst Commands to install and start the MariaDB server on RHEL, CentOS, or Fedora systems. This is a prerequisite for using MariaDB as the Ironic database backend. ```bash sudo dnf install mariadb mariadb-server sudo systemctl start mariadb.service ``` -------------------------------- ### Install UEFI Grub2 and Shim Packages (Ubuntu) Source: https://github.com/openstack/ironic/blob/master/doc/source/install/configure-pxe.rst Install the necessary packages for UEFI PXE booting on Ubuntu systems. ```bash sudo apt-get install grub-efi-amd64-signed shim-signed ``` -------------------------------- ### Example Response: Supported Boot Devices Source: https://github.com/openstack/ironic/blob/master/api-ref/source/index.md This is an example of a response body listing the boot devices supported by a Node's driver. ```default { "supported_boot_devices": [ "pxe" ] } ``` -------------------------------- ### Interact with Storage via Redfish - Python (sushy) Source: https://github.com/openstack/ironic/blob/master/doc/source/admin/drivers/idrac.rst Example using the sushy library with Redfish to discover systems, storage controllers, and drives. Ensure sushy is installed and network connectivity to the iDRAC is established. ```python import sushy client = sushy.Sushy('https://192.168.1.1', username='root', password='calvin', verify=False) for s in client.get_system_collection().get_members(): print("System: %(id)s" % {'id': s.identity}) for c in system1.storage.get_members(): print("\tController: %(id)s" % {'id': c.identity}) for d in c.drives: print("\t\tDrive: %(id)s" % {'id': d.identity}) ``` -------------------------------- ### Install UEFI Grub2 and Shim Packages (RHEL/CentOS/Fedora) Source: https://github.com/openstack/ironic/blob/master/doc/source/install/configure-pxe.rst Install the necessary packages for UEFI PXE booting on RHEL, CentOS, or Fedora systems. ```bash sudo dnf install grub2-efi-x64 shim ``` -------------------------------- ### Deploy Template Response Example Source: https://github.com/openstack/ironic/blob/master/api-ref/source/index.md This is an example of a successful response when retrieving a deploy template. It details the template's configuration, including BIOS settings. ```json { "created_at": "2016-08-18T22:28:48.643434+11:11", "extra": {}, "links": [ { "href": "http://10.60.253.180:6385/v1/deploy_templates/bbb45f41-d4bc-4307-8d1d-32f95ce1e920", "rel": "self" }, { "href": "http://10.60.253.180:6385/deploy_templates/bbb45f41-d4bc-4307-8d1d-32f95ce1e920", "rel": "bookmark" } ], "name": "CUSTOM_HYPERTHREADING_ON", "steps": [ { "args": { "settings": [ { "name": "LogicalProc", "value": "Enabled" } ] }, "interface": "bios", "priority": 150, "step": "apply_configuration" } ], "updated_at": null, "uuid": "bbb45f41-d4bc-4307-8d1d-32f95ce1e920" } ``` -------------------------------- ### Conductor Configuration Example 2 Source: https://github.com/openstack/ironic/blob/master/doc/source/install/enabling-drivers.rst Example configuration for a conductor with Redfish hardware type and different interfaces enabled. This configuration is compatible with the first example if the hardware types differ. ```ini [DEFAULT] enabled_hardware_types = redfish enabled_deploy_interfaces = ansible enabled_power_interfaces = redfish enabled_management_interfaces = redfish ``` -------------------------------- ### Install Ubuntu/Debian System Prerequisites Source: https://github.com/openstack/ironic/blob/master/doc/source/contributor/dev-quickstart.rst Installs necessary system packages for Ironic development on Ubuntu/Debian-based systems. ```bash sudo apt-get install build-essential python3-dev libssl-dev python3-pip libmysqlclient-dev libxml2-dev libxslt-dev git git-review libffi-dev gettext ipmitool psmisc graphviz libjpeg-dev qemu-utils ``` -------------------------------- ### Software RAID Configuration Example Source: https://github.com/openstack/ironic/blob/master/doc/source/admin/raid.rst Example of a software RAID configuration with logical disks. ```json { "logical_disks": [ { "size_gb": 100, "raid_level": "1", "is_root_volume": true, "controller": "software" }, { "size_gb": "MAX", "raid_level": "0", "controller": "software" } ] } ``` -------------------------------- ### Install and Configure Pre-commit Hooks Source: https://github.com/openstack/ironic/blob/master/doc/source/contributor/dev-quickstart.rst Install pre-commit to automatically check code spelling and linting before each commit. Ensure your path includes ~/.local/bin if installing per-user. ```bash pip install --user pre-commit cd /path/to/ironic/checkout pre-commit install --allow-missing-config ``` -------------------------------- ### Install networking-baremetal library Source: https://github.com/openstack/ironic/blob/master/doc/source/admin/networking.rst Install the networking-baremetal library using pip. This is required for the 'flat' network interface configuration. ```console pip install networking-baremetal ``` -------------------------------- ### Create a Virtual Machine with virt-install Source: https://github.com/openstack/ironic/blob/master/doc/source/user/creating-images.rst Use virt-install to create a new virtual machine for installing an operating system. Specify RAM, vCPUs, disk image, and the installation media. ```bash $ virt-install --name centos8 --ram 4096 --vcpus=2 -f centos8.qcow2 \ > --cdrom CentOS-8-x86_64-1905-dvd1.iso ``` -------------------------------- ### Install MySQL Server (Ubuntu/Debian) Source: https://github.com/openstack/ironic/blob/master/doc/source/contributor/local-dev-guide.rst Command to install the MySQL server package on Ubuntu or Debian-based systems. This is a prerequisite for using MySQL as the Ironic database backend. ```bash sudo apt-get install mysql-server ``` -------------------------------- ### Complete Configuration Example Source: https://github.com/openstack/ironic/blob/master/doc/source/install/enabling-drivers.rst A comprehensive example enabling multiple hardware types and various interfaces including boot, console, deploy, inspect, management, network, power, raid, storage, and vendor. ```ini [DEFAULT] enabled_hardware_types = ipmi,redfish enabled_boot_interfaces = pxe enabled_console_interfaces = ipmitool-socat,no-console enabled_deploy_interfaces = direct enabled_inspect_interfaces = agent enabled_management_interfaces = ipmitool,redfish enabled_network_interfaces = flat,neutron enabled_power_interfaces = ipmitool,redfish enabled_raid_interfaces = agent enabled_storage_interfaces = cinder,noop enabled_vendor_interfaces = ipmitool,no-vendor ``` -------------------------------- ### Prefix Match Comparator Example Source: https://github.com/openstack/ironic/blob/master/doc/source/references/trait-based-networking/filter-expression-reference.rst An example using the prefix match comparator (=~) to check if a port's category starts with 'green'. ```python port.category =~ 'green' ``` -------------------------------- ### Start Local Web Server for Documentation Source: https://github.com/openstack/ironic/blob/master/doc/source/contributor/documentation-contributing.rst Starts a local Python HTTP server in the doc/build/html directory to serve the generated documentation. Navigate to the provided URL in your browser to view. ```bash cd doc/build/html python -m http.server ``` -------------------------------- ### Create Python Virtualenv for Manual Setup Source: https://github.com/openstack/ironic/blob/master/doc/source/contributor/local-dev-guide.rst Create and develop a Python virtual environment for manual Ironic service setup. This command installs dependencies and sets up the environment for local development. ```bash tox -elocal-ironic-dev --notest --develop -r ``` -------------------------------- ### Registering Middleware in setup.cfg Source: https://github.com/openstack/ironic/blob/master/doc/source/admin/api-middleware.rst Example of how to register a custom middleware using the 'ironic.api.middleware' entry point in a setup.cfg file. ```ini [entry_points] ironic.api.middleware = my-middleware = my_package.middleware:MyMiddleware ``` -------------------------------- ### Create and Adopt a Node Source: https://github.com/openstack/ironic/blob/master/doc/source/admin/adoption.rst This sequence of commands demonstrates the process of creating a new node, configuring its driver details, associating a port, and finally adopting the node into Ironic. Ensure the OS_BAREMETAL_API_VERSION is set to 1.17 or higher for adoption capabilities. Replace placeholders like , , , , , and with actual values. ```bash export OS_BAREMETAL_API_VERSION=1.17 baremetal node create --name testnode \ --driver ipmi \ --driver-info ipmi_address= \ --driver-info ipmi_username= \ --driver-info ipmi_password= \ --driver-info deploy_kernel= \ --driver-info deploy_ramdisk= baremetal port create --node baremetal node set testnode \ --instance-info image_source="http://localhost:8080/blankimage" baremetal node manage testnode --wait baremetal node adopt testnode --wait ``` -------------------------------- ### Install disk-image-builder Source: https://github.com/openstack/ironic/blob/master/doc/source/user/creating-images.rst Install the diskimage-builder package. It is recommended to use a virtual environment to avoid global installations. ```console # pip install diskimage-builder ``` -------------------------------- ### Install or Upgrade Tox Source: https://github.com/openstack/ironic/blob/master/doc/source/contributor/dev-quickstart.rst Installs or upgrades tox to at least version 4.28.0 using pip. Ensure $HOME/.local/bin is in your PATH if installing per-user. ```bash pip install tox --user ``` -------------------------------- ### Create iPXE Directories Source: https://github.com/openstack/ironic/blob/master/doc/source/install/configure-pxe.rst Ensure TFTP and HTTP boot directories exist and are writable by the ironic-conductor user for iPXE setup. ```bash sudo mkdir -p /tftpboot sudo mkdir -p /httpboot sudo chown -R ironic /tftpboot sudo chown -R ironic /httpboot ``` -------------------------------- ### Node BIOS Settings Example Source: https://github.com/openstack/ironic/blob/master/api-ref/source/index.md This example shows the structure of a Node's BIOS settings, including various attributes like name, value, and allowable values. It is useful for understanding how BIOS configurations are represented. ```json { "bios": [ { "created_at": "2016-08-18T22:28:49.653974+00:00", "updated_at": "2016-08-18T22:28:49.653974+00:00", "links": [ { "href": "http://127.0.0.1:6385/v1/nodes/6d85703a-565d-469a-96ce-30b6de53079d/bios/virtualization", "rel": "self" }, { "href": "http://127.0.0.1:6385/v1/nodes/6d85703a-565d-469a-96ce-30b6de53079d/bios/virtualization", "rel": "bookmark" } ], "name": "Virtualization", "value": "Enabled", "attribute_type": "Enumeration", "allowable_values": ["Enabled", "Disabled"], "lower_bound": null, "max_length": null, "min_length": null, "read_only": false, "reset_required": null, "unique": null, "upper_bound": null } ] } ``` -------------------------------- ### Install iPXE Package (Ubuntu) Source: https://github.com/openstack/ironic/blob/master/doc/source/install/configure-pxe.rst Install the iPXE package on Ubuntu systems. ```bash apt-get install ipxe ``` -------------------------------- ### Setup Entry Points for Custom Driver Source: https://github.com/openstack/ironic/blob/master/doc/source/contributor/drivers.rst Configuration for setuptools entry points to register custom hardware types and interfaces. ```ini ironic.hardware.types = my-hardware = ironic.drivers.my_hardware:MyHardware ironic.hardware.interfaces.power = my-power = ironic.drivers.modules.my_hardware:MyPower ironic.hardware.interfaces.management = my-management = ironic.drivers.modules.my_hardware:MyManagement ``` -------------------------------- ### Install DNSMasq TFTP Server Source: https://github.com/openstack/ironic/blob/master/doc/source/install/configure-pxe.rst Install the necessary package for DNSMasq to provide TFTP services. ```bash sudo dnf install openstack-ironic-dnsmasq-tftp-server ``` -------------------------------- ### Install RHEL/CentOS/Fedora System Prerequisites Source: https://github.com/openstack/ironic/blob/master/doc/source/contributor/dev-quickstart.rst Installs necessary system packages for Ironic development on RHEL/CentOS/Fedora-based systems. ```bash sudo dnf install python3-devel openssl-devel python3-pip mysql-devel libxml2-devel libxslt-devel git git-review libffi-devel gettext ipmitool psmisc graphviz gcc libjpeg-turbo-devel qemu-img ``` -------------------------------- ### Create a partition image for local boot Source: https://github.com/openstack/ironic/blob/master/doc/source/install/configure-glance-images.rst Upload a partition image for local boot and set the 'img_type' property to 'partition'. ```console $ openstack image create my-image --public \ --disk-format qcow2 --container-format bare \ --property img_type=partition --file my-image.qcow2 ``` -------------------------------- ### Boot Node with Virtual Media Ramdisk Source: https://github.com/openstack/ironic/blob/master/doc/source/admin/drivers/redfish.rst Configure a node to boot using the ramdisk deploy interface and redfish-virtual-media boot interface, specifying a boot ISO image. The instance will be booted using the supplied ISO image and will have a provision_state of ACTIVE. ```bash baremetal node set \ --boot-interface redfish-virtual-media \ --deploy-interface ramdisk \ --instance_info boot_iso=http://url/to.iso ``` -------------------------------- ### Inequality Comparator Example Source: https://github.com/openstack/ironic/blob/master/doc/source/references/trait-based-networking/filter-expression-reference.rst An example using the inequality comparator (!=) to match networks whose name is not 'private'. ```python network.name != 'private' ``` -------------------------------- ### Deploy Node Source: https://github.com/openstack/ironic/blob/master/doc/source/admin/boot-from-volume.rst Initiate the deployment of a node after configuring it for boot from volume. ```bash baremetal node deploy $NODE_UUID ``` -------------------------------- ### Install networking-generic-switch Source: https://github.com/openstack/ironic/blob/master/doc/source/install/standalone/networking.rst Install the required networking-generic-switch library for the generic-switch driver. This is necessary for the standalone networking service to function. ```bash pip install -r driver-requirements.txt ``` -------------------------------- ### Create Bare Metal Deploy Template with Steps from File Source: https://github.com/openstack/ironic/blob/master/doc/source/admin/node-deployment.rst Creates a deploy template with hyperthreading enabled using steps defined in a separate file. ```console baremetal deploy template create \ CUSTOM_HYPERTHREADING_ON \ ---steps my-deploy-steps.txt ``` -------------------------------- ### Create Deploy Templates for Intel SST-PP Profiles Source: https://github.com/openstack/ironic/blob/master/doc/source/admin/drivers/intel-ipmi.rst Create deploy templates for each Intel SST-PP configuration profile. These templates specify the 'configure_intel_speedselect' deploy step with the desired configuration and socket count. ```bash baremetal deploy template create \ CUSTOM_INTEL_SPEED_SELECT_CONFIG_BASE \ --steps '[{"interface": "management", "step": "configure_intel_speedselect", "args": {"intel_speedselect_config": "0x00", "socket_count": 2}, "priority": 150}]' ``` ```bash baremetal deploy template create \ CUSTOM_INTEL_SPEED_SELECT_CONFIG_1 \ --steps '[{"interface": "management", "step": "configure_intel_speedselect", "args": {"intel_speedselect_config": "0x01", "socket_count": 2}, "priority": 150}]' ``` ```bash baremetal deploy template create \ CUSTOM_INTEL_SPEED_SELECT_CONFIG_2 \ --steps '[{"interface": "management", "step": "configure_intel_speedselect", "args": {"intel_speedselect_config": "0x02", "socket_count": 2}, "priority": 150}]' ``` -------------------------------- ### Install iPXE Package (RHEL/CentOS/Fedora) Source: https://github.com/openstack/ironic/blob/master/doc/source/install/configure-pxe.rst Install the iPXE package with SNP support on RHEL, CentOS, or Fedora systems. ```bash dnf install ipxe-snponly-x86_64 ``` -------------------------------- ### Node Console Notification Example Source: https://github.com/openstack/ironic/blob/master/doc/source/admin/notifications.rst Example payload for a baremetal.node.console_set.end notification. This event is sent when the console is enabled or restored. ```json { "priority": "info", "payload":{ "ironic_object.namespace":"ironic", "ironic_object.name":"NodePayload", "ironic_object.version":"1.15", "ironic_object.data":{ "clean_step": null, "conductor_group": "", "console_enabled": true, "created_at": "2016-01-26T20:41:03+00:00", "deploy_step": null, "description": "my sample node", "driver": "ipmi", "extra": {}, "inspection_finished_at": null, "inspection_started_at": null, "instance_info": {}, "instance_uuid": null, "last_error": null, "lessee": null, "maintenance": false, "maintenance_reason": null, "fault": null, "bios_interface": "no-bios", "boot_interface": "pxe", "console_interface": "no-console", "deploy_interface": "direct", "inspect_interface": "no-inspect", "management_interface": "ipmitool", "network_interface": "flat", "power_interface": "ipmitool", "raid_interface": "no-raid", "rescue_interface": "no-rescue", "storage_interface": "noop", "vendor_interface": "no-vendor", "name": null, "owner": null, "power_state": "power off", "properties": { "memory_mb": 4096, "cpu_arch": "x86_64", "local_gb": 10, "cpus": 8}, "protected": false, "protected_reason": null, "provision_state": "available", "provision_updated_at": "2016-01-27T20:41:03+00:00", "resource_class": null, "retired": null, "retired_reason": null, "target_power_state": null, "target_provision_state": null, "traits": [ "CUSTOM_TRAIT1", "HW_CPU_X86_VMX"], "updated_at": "2016-01-27T20:41:03+00:00", "uuid": "1be26c0b-03f2-4d2e-ae87-c02d7f33c123" } }, "event_type":"baremetal.node.console_set.end", "publisher_id":"ironic-conductor.hostname01" } ``` -------------------------------- ### Set ISO Image for Node Boot (Shell) Source: https://github.com/openstack/ironic/blob/master/doc/source/admin/ramdisk-boot.rst Configure a node to boot from an ISO image. The URL should point to the accessible location of the .iso file. This uses the 'ramdisk' deploy interface. ```shell baremetal node set \ --instance-info boot_iso=http://path/to/boot.iso baremetal node deploy ``` -------------------------------- ### Example Node BIOS Settings Source: https://github.com/openstack/ironic/blob/master/api-ref/source/index.md This JSON object shows an example of a node's BIOS settings, including creation and update timestamps, links, the setting name, and its value. This format is returned when listing BIOS settings for a node. ```json { "bios": [ { "created_at": "2016-08-18T22:28:49.653974+00:00", "updated_at": "2016-08-18T22:28:49.653974+00:00", "links": [ { "href": "http://127.0.0.1:6385/v1/nodes/6d85703a-565d-469a-96ce-30b6de53079d/bios/virtualization", "rel": "self" }, { "href": "http://127.0.0.1:6385/v1/nodes/6d85703a-565d-469a-96ce-30b6de53079d/bios/virtualization", "rel": "bookmark" } ], "name": "Virtualization", "value": "Enabled" } ] } ``` -------------------------------- ### Install Sushy library Source: https://github.com/openstack/ironic/blob/master/doc/source/admin/drivers/redfish.rst Install the Sushy library on the ironic conductor node(s) using pip. This is a prerequisite for the Redfish driver. ```bash sudo pip install sushy ``` -------------------------------- ### Detailed Deploy Template Response Source: https://github.com/openstack/ironic/blob/master/api-ref/source/index.md This example illustrates a detailed response for a single deploy template, including creation and update timestamps, extra metadata, and deploy steps. ```javascript { "deploy_templates": [ { "created_at": "2016-08-18T22:28:48.643434+11:11", "extra": {}, "links": [ { "href": "http://10.60.253.180:6385/v1/deploy_templates/bbb45f41-d4bc-4307-8d1d-32f95ce1e920", "rel": "self" }, { "href": "http://10.60.253.180:6385/deploy_templates/bbb45f41-d4bc-4307-8d1d-32f95ce1e920", "rel": "bookmark" } ], "name": "CUSTOM_HYPERTHREADING_ON", "steps": [ { "args": { "settings": [ { "name": "LogicalProc", "value": "Enabled" } ] }, "interface": "bios", "priority": 150, "step": "apply_configuration" } ], "updated_at": null, "uuid": "bbb45f41-d4bc-4307-8d1d-32f95ce1e920" } ] } ``` -------------------------------- ### Ironic Allocation Response Example Source: https://github.com/openstack/ironic/blob/master/api-ref/source/index.md This is an example of a successful response when retrieving or creating an allocation. It shows the structure of the allocation object. ```json { "candidate_nodes": [], "created_at": "2019-02-20T09:43:58+00:00", "extra": {}, "last_error": null, "links": [ { "href": "http://127.0.0.1:6385/v1/allocations/5344a3e2-978a-444e-990a-cbf47c62ef88", "rel": "self" }, { "href": "http://127.0.0.1:6385/allocations/5344a3e2-978a-444e-990a-cbf47c62ef88", "rel": "bookmark" } ], "name": "allocation-1", "node_uuid": "6d85703a-565d-469a-96ce-30b6de53079d", "owner": null, "resource_class": "bm-large", "state": "active", "traits": [], "updated_at": "2019-02-20T09:43:58+00:00", "uuid": "5344a3e2-978a-444e-990a-cbf47c62ef88" } ``` -------------------------------- ### Verify Port Group Setup in Instance Source: https://github.com/openstack/ironic/blob/master/doc/source/admin/portgroups.rst After deployment, run this command inside the instance to check the port group configuration. 'X' is an autogenerated number for each configured port group. ```bash cat /proc/net/bonding/bondX ``` -------------------------------- ### Example Node List Source: https://github.com/openstack/ironic/blob/master/api-ref/source/index.md Provides an example JSON structure for a list of nodes, showcasing various properties and their typical values. ```APIDOC ## Example Node List ### Description An example of a detailed list of Nodes. ### Response Example ```json { "nodes": [ { "allocation_uuid": "5344a3e2-978a-444e-990a-cbf47c62ef88", "boot_interface": null, "chassis_uuid": null, "clean_step": {}, "conductor": "compute1.localdomain", "conductor_group": "group-1", "console_enabled": false, "console_interface": null, "created_at": "2016-08-18T22:28:48.643434+11:11", "deploy_interface": null, "deploy_step": {}, "description": null, "driver": "fake", "driver_info": { "ipmi_password": "******", "ipmi_username": "ADMIN" }, "driver_internal_info": { "clean_steps": null }, "extra": {}, "inspect_interface": null, "inspection_finished_at": null, "inspection_started_at": null, "instance_info": {}, "instance_uuid": "5344a3e2-978a-444e-990a-cbf47c62ef88", "instance_name": "my-test-instance", "last_error": null, "lessee": null, "links": [ { "href": "http://127.0.0.1:6385/v1/nodes/6d85703a-565d-469a-96ce-30b6de53079d", "rel": "self" }, { "href": "http://127.0.0.1:6385/nodes/6d85703a-565d-469a-96ce-30b6de53079d", "rel": "bookmark" } ], "maintenance": false, "maintenance_reason": null, "management_interface": null, "name": "test_node_classic", "network_data": {}, "network_interface": "flat", "owner": "john doe", "portgroups": [ { "href": "http://127.0.0.1:6385/v1/nodes/6d85703a-565d-469a-96ce-30b6de53079d/portgroups", "rel": "self" } ] } ] } ``` ``` -------------------------------- ### Boolean AND Operator Example Source: https://github.com/openstack/ironic/blob/master/doc/source/references/trait-based-networking/filter-expression-reference.rst An example demonstrating the use of the AND boolean operator (&&) to match a port that meets two specific criteria. ```python port.vendor == 'purple' && port.category == 'private' ``` -------------------------------- ### Create and Launch Instance from Volume using OpenStack CLI Source: https://github.com/openstack/ironic/blob/master/doc/source/contributor/ironic-boot-from-volume.rst These commands demonstrate how to authenticate, query image IDs, create SSH keys, create a Cinder volume from an image, and then launch a baremetal instance using that volume. ```bash # set up the user for authentication purposes # note that all users can be seen in /etc/openstack/clouds.yaml export OS_CLOUD=devstack-admin-demo # query the image id of the default cirros image image=$(openstack image show $DEFAULT_IMAGE_NAME -f value -c id) # create keypair ssh-keygen openstack keypair create --public-key ~/.ssh/id_rsa.pub default # create volume volume=$(openstack volume create --image $image --size 1 my-volume -f value -c id) # spawn instance openstack server create --flavor baremetal --volume $volume --key-name default testing ``` -------------------------------- ### Check Unreleased Changes Example Source: https://github.com/openstack/ironic/blob/master/doc/source/contributor/releasing.rst Example of checking unreleased changes for the Ironic-python-agent in the 'ussuri' series from the 'releases' repository directory. ```bash tox -e venv -- list-unreleased-changes ussuri openstack/ironic-python-agent ``` -------------------------------- ### Create Nova Instance on Baremetal Flavor Source: https://github.com/openstack/ironic/blob/master/doc/source/contributor/devstack-guide.rst Launches a Nova instance using the 'baremetal' flavor, specifying the network ID, image, and key name. This initiates the deployment process. ```bash openstack server create --flavor baremetal --nic net-id=$net_id --image $image --key-name default testing ``` -------------------------------- ### Port CRUD Notification Example Source: https://github.com/openstack/ironic/blob/master/doc/source/admin/notifications.rst Example of a baremetal.port.update.end notification payload. This notification is sent after a port resource has been successfully updated. ```json { "priority": "info", "payload":{ "ironic_object.namespace":"ironic", "ironic_object.name":"PortCRUDPayload", "ironic_object.version":"1.3", "ironic_object.data":{ "address": "77:66:23:34:11:b7", "created_at": "2016-02-11T15:23:03+00:00", "node_uuid": "5b236cab-ad4e-4220-b57c-e827e858745a", "extra": {}, "is_smartnic": True, "local_link_connection": {}, "physical_network": "physnet1", "portgroup_uuid": "bd2f385e-c51c-4752-82d1-7a9ec2c25f24", "pxe_enabled": True, "updated_at": "2016-03-27T20:41:03+00:00", "uuid": "1be26c0b-03f2-4d2e-ae87-c02d7f33c123" } }, "event_type":"baremetal.port.update.end", "publisher_id":"ironic-api.hostname02" } ``` -------------------------------- ### Create Bare Metal Deploy Template with Steps from Stdin Source: https://github.com/openstack/ironic/blob/master/doc/source/admin/node-deployment.rst Creates a deploy template with hyperthreading enabled by piping steps from standard input. ```console cat my-deploy-steps.txt | baremetal deploy template create \ CUSTOM_HYPERTHREADING_ON \ --steps - ``` -------------------------------- ### Example Parsed LLDP Data Source: https://github.com/openstack/ironic/blob/master/doc/source/admin/inspection/hooks.rst An example of the structure for parsed LLDP information, which is stored in the 'parsed_lldp' dictionary in plugin data. ```json "parsed_lldp": { "eth0": { "switch_chassis_id": "11:22:33:aa:bb:cc", "switch_system_name": "sw01-dist-1b-b12" } } ``` -------------------------------- ### Conductor Configuration Example 1 Source: https://github.com/openstack/ironic/blob/master/doc/source/install/enabling-drivers.rst Example configuration for a conductor with IPMI hardware type and specific interfaces enabled. Ensure interface sets match across conductors for the same hardware type. ```ini [DEFAULT] enabled_hardware_types = ipmi enabled_deploy_interfaces = direct enabled_power_interfaces = ipmitool enabled_management_interfaces = ipmitool ``` -------------------------------- ### Serve Built Documentation Locally Source: https://github.com/openstack/ironic/blob/master/doc/source/contributor/dev-quickstart.rst Serve the locally built documentation using Python's SimpleHTTPServer. This allows viewing the documentation in a web browser. ```bash cd ~/ironic/doc/build/html/ python3 -m SimpleHTTPServer 8000 ``` -------------------------------- ### Install and Upgrade Ironic Dependencies Source: https://github.com/openstack/ironic/blob/master/doc/source/contributor/local-dev-guide.rst Installs or upgrades Ironic and all its Python dependencies in the local development environment. Ensures you have the latest versions. ```bash cd ~/ironic . .tox/local-ironic-dev/bin/activate pip install -U -e . ``` -------------------------------- ### Create Single Container Firmware Update Runbook Source: https://github.com/openstack/ironic/blob/master/doc/source/admin/container-based-steps.rst Example of creating a runbook that executes a single firmware update container step. Ensure the container URL is correctly specified. ```bash baremetal runbook create \ --name CUSTOM_CONTAINER_FW_UPDATE \ --steps '[\ {\ "interface": "deploy",\ "step": "container_clean_step",\ "args": {\ "container_url": "docker://registry.example.com/firmware-tool:latest"\ },\ "order": 1\ }]' ``` -------------------------------- ### Node Creation Request Example Source: https://github.com/openstack/ironic/blob/master/api-ref/source/index.md Example of a request body for creating a node with a dynamic driver, including various optional fields. ```APIDOC ## POST /v1/nodes ### Description Creates a new baremetal node resource. ### Method POST ### Endpoint /v1/nodes ### Parameters #### Request Body - **instance_uuid** (string) - Optional - UUID of the Nova instance associated with this Node. Note: This field does not follow standard JSON PATCH RFC 6902 behavior. The “add” operator cannot replace an existing instance_uuid value. Attempting to do so will result in a 409 Conflict error. - **instance_name** (string) - Optional - A human-readable name for the instance deployed on this node. This is automatically synchronized with the `display_name` from the node’s `instance_info` for backward compatibility with Nova. - **maintenance** (boolean) - Optional - Whether or not this Node is currently in “maintenance mode”. Setting a Node into maintenance mode removes it from the available resource pool and halts some internal automation. - **maintenance_reason** (string) - Optional - User-settable description of the reason why this Node was placed into maintenance mode. - **network_data** (JSON) - Optional - Static network configuration in the OpenStack network data format to use during deployment and cleaning. - **parent_node** (string) - Optional - An optional UUID which can be used to denote the “parent” baremetal node. - **protected** (boolean) - Optional - Whether the node is protected from undeploying, rebuilding and deletion. - **protected_reason** (string) - Optional - The reason the node is marked as protected. - **retired** (boolean) - Optional - Whether the node is retired and can hence no longer be provided. - **retired_reason** (string) - Optional - The reason the node is marked as retired. ### Request Example ```json { "instance_uuid": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "instance_name": "example-instance", "maintenance": false, "maintenance_reason": "Node is operational.", "network_data": {}, "parent_node": "f0e9d8c7-b6a5-4321-0987-654321fedcba", "protected": false, "protected_reason": "Node is not protected.", "retired": false, "retired_reason": "Node is not retired." } ``` ### Response #### Success Response (200) - **Node object** (object) - Details of the created node. #### Response Example ```json { "instance_uuid": "a1b2c3d4-e5f6-7890-1234-567890abcdef", "instance_name": "example-instance", "maintenance": false, "maintenance_reason": "Node is operational.", "network_data": {}, "parent_node": "f0e9d8c7-b6a5-4321-0987-654321fedcba", "protected": false, "protected_reason": "Node is not protected.", "retired": false, "retired_reason": "Node is not retired.", "uuid": "12345678-abcd-1234-abcd-123456789012", "created_at": "2023-10-27T10:00:00Z", "updated_at": "2023-10-27T10:00:00Z" } ``` ```