| 1 |
Command Line Reference |
| 2 |
====================== |
| 3 |
|
| 4 |
Integration for two command lines tools are provided: ironicclient_ and |
| 5 |
OpenStackClient_. |
| 6 |
|
| 7 |
Integration with ``baremetal`` CLI |
| 8 |
---------------------------------- |
| 9 |
|
| 10 |
The ``baremetal`` command is provided by ironicclient_, so it has to be |
| 11 |
installed, e.g.: |
| 12 |
|
| 13 |
.. code-block:: shell |
| 14 |
|
| 15 |
pip install 'python-ironicclient>=4.1.0' |
| 16 |
|
| 17 |
All commands are prefixed with ``baremetal introspection``. See `standalone |
| 18 |
ironic CLI documentation`_ for details on how to use it. |
| 19 |
|
| 20 |
.. _ironicclient: https://docs.openstack.org/python-ironicclient/ |
| 21 |
.. _standalone ironic CLI documentation: https://docs.openstack.org/python-ironicclient/latest/cli/standalone.html |
| 22 |
|
| 23 |
Integration with ``openstack baremetal`` CLI |
| 24 |
-------------------------------------------- |
| 25 |
|
| 26 |
The ``openstack`` command is provided by ironicclient_, so it has to be |
| 27 |
installed, e.g.: |
| 28 |
|
| 29 |
.. code-block:: shell |
| 30 |
|
| 31 |
pip install python-openstackclient. |
| 32 |
|
| 33 |
All commands are prefixed with ``baremetal introspection``. |
| 34 |
|
| 35 |
Common arguments |
| 36 |
~~~~~~~~~~~~~~~~ |
| 37 |
|
| 38 |
All commands accept the following arguments: |
| 39 |
|
| 40 |
* ``--inspector-url`` the **Ironic Inspector** API endpoint. If missing, |
| 41 |
the endpoint will be fetched from the service catalog. |
| 42 |
|
| 43 |
* ``--inspector-api-version`` requested API version, see :ref:`api-versioning` |
| 44 |
for details. |
| 45 |
|
| 46 |
Start introspection on a node |
| 47 |
----------------------------- |
| 48 |
|
| 49 |
:: |
| 50 |
|
| 51 |
$ openstack baremetal introspection start [--wait] [--check-errors] NODE_ID [NODE_ID ...] |
| 52 |
|
| 53 |
* ``NODE_ID`` - Ironic node UUID or name; |
| 54 |
|
| 55 |
Note that the CLI call accepts several UUID's and will stop on the first error. |
| 56 |
|
| 57 |
.. note:: |
| 58 |
This CLI call doesn't rely on Ironic, and the introspected node will be |
| 59 |
left in ``MANAGEABLE`` state. This means that the Ironic node is not |
| 60 |
protected from other operations being performed by Ironic, which could |
| 61 |
cause inconsistency in the node's state, and lead to operational errors. |
| 62 |
|
| 63 |
With ``--wait`` flag it waits until introspection ends for all given nodes, |
| 64 |
then displays the results as a table. |
| 65 |
|
| 66 |
The ``--check-errors`` flag verifies if any error occurred during the |
| 67 |
introspection of the selected nodes while waiting for the results. If any error |
| 68 |
has occurred in the introspection result of selected nodes no output is |
| 69 |
displayed, otherwise it shows the result as a table. |
| 70 |
|
| 71 |
.. note:: |
| 72 |
``--check-errors`` can only be used with ``--wait`` |
| 73 |
|
| 74 |
Query introspection status |
| 75 |
-------------------------- |
| 76 |
|
| 77 |
:: |
| 78 |
|
| 79 |
$ openstack baremetal introspection status NODE_ID |
| 80 |
|
| 81 |
* ``NODE_ID`` - Ironic node UUID or name. |
| 82 |
|
| 83 |
Returns following information about a node introspection status: |
| 84 |
|
| 85 |
* ``error``: an error string or ``None`` |
| 86 |
* ``finished``: ``True/False`` |
| 87 |
* ``finished_at``: an ISO8601 timestamp or ``None`` if not finished |
| 88 |
* ``started_at``: an ISO8601 timestamp |
| 89 |
* ``uuid``: node UUID |
| 90 |
|
| 91 |
List introspection statuses |
| 92 |
--------------------------- |
| 93 |
|
| 94 |
This command supports pagination. |
| 95 |
|
| 96 |
:: |
| 97 |
|
| 98 |
$ openstack baremetal introspection list [--marker] [--limit] |
| 99 |
|
| 100 |
* ``--marker`` the last item on the previous page, a UUID |
| 101 |
* ``--limit`` the amount of items to list, an integer, 50 by default |
| 102 |
|
| 103 |
Shows a table with the following columns: |
| 104 |
|
| 105 |
* ``Error``: an error string or ``None`` |
| 106 |
* ``Finished at``: an ISO8601 timestamp or ``None`` if not finished |
| 107 |
* ``Started at``: and ISO8601 timestamp |
| 108 |
* ``UUID``: node UUID |
| 109 |
|
| 110 |
.. note:: |
| 111 |
The server orders the introspection status items according to the |
| 112 |
``Started at`` column, newer items first. |
| 113 |
|
| 114 |
Retrieving introspection data |
| 115 |
----------------------------- |
| 116 |
|
| 117 |
:: |
| 118 |
|
| 119 |
$ openstack baremetal introspection data save [--file file_name] [--unprocessed] NODE_ID |
| 120 |
|
| 121 |
* ``NODE_ID`` - Ironic node UUID or name; |
| 122 |
* ``file_name`` - file name to save data to. If file name is not provided, |
| 123 |
the data is dumped to stdout. |
| 124 |
* ``--unprocessed`` - if set, retrieves the unprocessed data received from the |
| 125 |
ramdisk. |
| 126 |
|
| 127 |
.. note:: |
| 128 |
This feature requires Swift support to be enabled in **Ironic Inspector** |
| 129 |
by setting ``[processing]store_data`` configuration option to ``swift``. |
| 130 |
|
| 131 |
Aborting introspection |
| 132 |
---------------------- |
| 133 |
|
| 134 |
:: |
| 135 |
|
| 136 |
$ openstack baremetal introspection abort NODE_ID |
| 137 |
|
| 138 |
* ``NODE_ID`` - Ironic node UUID or name. |
| 139 |
|
| 140 |
Reprocess stored introspection data |
| 141 |
----------------------------------- |
| 142 |
|
| 143 |
:: |
| 144 |
|
| 145 |
$ openstack baremetal introspection reprocess NODE_ID |
| 146 |
|
| 147 |
* ``NODE_ID`` - Ironic node UUID or name. |
| 148 |
|
| 149 |
.. note:: |
| 150 |
This feature requires Swift store to be enabled for **Ironic Inspector** |
| 151 |
by setting ``[processing]store_data`` configuration option to ``swift``. |
| 152 |
|
| 153 |
Introspection Rules API |
| 154 |
----------------------- |
| 155 |
|
| 156 |
Creating a rule |
| 157 |
~~~~~~~~~~~~~~~ |
| 158 |
|
| 159 |
:: |
| 160 |
|
| 161 |
$ openstack baremetal introspection rule import <JSON FILE> |
| 162 |
|
| 163 |
* ``rule_json`` dictionary with a rule representation, see |
| 164 |
:py:meth:`ironic_inspector_client.RulesAPI.from_json` for details. |
| 165 |
|
| 166 |
Listing all rules |
| 167 |
~~~~~~~~~~~~~~~~~ |
| 168 |
|
| 169 |
:: |
| 170 |
|
| 171 |
$ openstack baremetal introspection rule list |
| 172 |
|
| 173 |
Returns list of short rule representations, containing only description, UUID |
| 174 |
and links. |
| 175 |
|
| 176 |
Deleting all rules |
| 177 |
~~~~~~~~~~~~~~~~~~ |
| 178 |
|
| 179 |
:: |
| 180 |
|
| 181 |
$ openstack baremetal introspection rule purge |
| 182 |
|
| 183 |
Deleting a rule |
| 184 |
~~~~~~~~~~~~~~~ |
| 185 |
|
| 186 |
:: |
| 187 |
|
| 188 |
$ openstack baremetal introspection rule delete <UUID> |
| 189 |
|
| 190 |
* ``UUID`` rule UUID. |
| 191 |
|
| 192 |
Using names instead of UUID |
| 193 |
--------------------------- |
| 194 |
|
| 195 |
Starting with baremetal introspection API 1.5 (provided by **Ironic Inspector** |
| 196 |
3.3.0) it's possible to use node names instead of UUIDs in all Python and CLI |
| 197 |
calls. |
| 198 |
|
| 199 |
|
| 200 |
.. _introspection rules documentation: https://docs.openstack.org/ironic-inspector/latest/usage.html#introspection-rules |
| 201 |
|
| 202 |
|
| 203 |
List interface data |
| 204 |
------------------- |
| 205 |
|
| 206 |
:: |
| 207 |
|
| 208 |
$ openstack baremetal introspection interface list NODE_IDENT |
| 209 |
[--fields=<field>] [--vlan=<vlan>] |
| 210 |
|
| 211 |
* ``NODE_IDENT`` - Ironic node UUID or name |
| 212 |
* ``fields`` - name of one or more interface columns to display. |
| 213 |
* ``vlan`` - list only interfaces configured for this vlan id |
| 214 |
|
| 215 |
Returns a list of interface data, including attached switch information, |
| 216 |
for each interface on the node. |
| 217 |
|
| 218 |
Show interface data |
| 219 |
------------------- |
| 220 |
|
| 221 |
:: |
| 222 |
|
| 223 |
$ openstack baremetal introspection interface show NODE_IDENT INTERFACE |
| 224 |
[--fields=<field>] |
| 225 |
|
| 226 |
* ``NODE_IDENT`` - Ironic node UUID or name |
| 227 |
* ``INTERFACE`` - interface name on this node |
| 228 |
* ``fields`` - name of one or more interface rows to display. |
| 229 |
|
| 230 |
Show interface data, including attached switch information, |
| 231 |
for a particular node and interface. |
| 232 |
|
| 233 |
.. _OpenStackClient: https://docs.openstack.org/python-openstackclient/latest/ |