Tag: pxe

  • OpenStack Ironic – CLI Cheat Sheet

    home-iron

    Ironic is the baremetal provisioning component of OpenStack. Ironic interacts with hardware through a set of plug-ins. Technologies leveraged are PXE and IPMI as well as a few vendor specific plug-ins.

    Here are a few OpenStack Ironic commands that I have found useful when troubleshooting.

    List nodes registered with Ironic.

    $ ironic node-list

     

    Show details of a specific node using the node UUID – your node UUID will differ.

    $ ironic node-show 5492ee96-218f-4e0e-b5b3-4931ba2c9ede

     

    Disable maintenance mode for a specific node.

    $ ironic node-set-maintenance 5492ee96-218f-4e0e-b5b3-4931ba2c9ede off

     

    The command below is useful for watching logs. Note…

    • -u is used to specify the unit
    • -f is used to tail logs

    $sudo journalctl -u openstack-ironic-conductor -u openstack-ironic-api -f

     

    Make a node available for scheduling by nova. Below is an example using a UUID in my environment.

    $ ironic node-set-provision-state 5492ee96-218f-4e0e-b5b3-4931ba2c9ede provide

     

    Show Mac address for a particular ironic node – uses UUID.

    $ ironic node-port-list 5492ee96-218f-4e0e-b5b3-4931ba2c9ede

    More examples to come.

    Delete a node – using UUID

    $ironic node-set-provision-state f7f58a13-1ac8-4d3a-b1b8-e7a02a07a323 deleted

    Force Delete a Node from the Database – Use this option when your node is stuck in the “deleting” Provisioning State.

    Log into mysql database

    [stack@undercloud] # sudo mysql -u root

    Switch to the ironic database

    MariaDB [(none)]> use ironic;
    Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -A

    Force state change using UUID of Ironic Node.

    MariaDB [ironic]> UPDATE nodes SET provision_state=”available”, target_provision_state=NULL WHERE uuid=”f7f58a13-1ac8-4d3a-b1b8-e7a02a07a323″;
    Query OK, 1 row affected (0.01 sec)
    Rows matched: 1 Changed: 1 Warnings: 0

    MariaDB [ironic]> exit
    Bye