summaryrefslogtreecommitdiff
path: root/doc/source/install/include/root-device-hints.rst
blob: e53b3393e6e341e2bdfc6e8e9984c6cfcefdfd6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
.. _root-device-hints:

Specifying the disk for deployment (root device hints)
------------------------------------------------------

The Bare Metal service supports passing hints to the deploy ramdisk about
which disk it should pick for the deployment. The list of supported hints is:

* model (STRING): device identifier
* vendor (STRING): device vendor
* serial (STRING): disk serial number
* size (INT): size of the device in GiB

  .. note::
    A node's 'local_gb' property is often set to a value 1 GiB less than the
    actual disk size to account for partitioning (this is how DevStack, TripleO
    and Ironic Inspector work, to name a few). However, in this case ``size``
    should be the actual size. For example, for a 128 GiB disk ``local_gb``
    will be 127, but size hint will be 128.

* wwn (STRING): unique storage identifier
* wwn_with_extension (STRING): unique storage identifier with the vendor extension appended
* wwn_vendor_extension (STRING): unique vendor storage identifier
* rotational (BOOLEAN): whether it's a rotational device or not. This
  hint makes it easier to distinguish HDDs (rotational) and SSDs (not
  rotational) when choosing which disk Ironic should deploy the image onto.
* hctl (STRING): the SCSI address (Host, Channel, Target and Lun),
  e.g '1:0:0:0'
* name (STRING): the device name, e.g /dev/md0


  .. warning::
     The root device hint name should only be used for devices with
     constant names (e.g RAID volumes). For SATA, SCSI and IDE disk
     controllers this hint is not recommended because the order in which
     the device nodes are added in Linux is arbitrary, resulting in
     devices like /dev/sda and /dev/sdb `switching around at boot time
     <https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Storage_Administration_Guide/persistent_naming.html>`_.


To associate one or more hints with a node, update the node's properties
with a ``root_device`` key, for example::

    ironic node-update <node-uuid> add properties/root_device='{"wwn": "0x4000cca77fc4dba1"}'


That will guarantee that Bare Metal service will pick the disk device that
has the ``wwn`` equal to the specified wwn value, or fail the deployment if it
can not be found.

The hints can have an operator at the beginning of the value string. If
no operator is specified the default is ``==`` (for numerical values)
and ``s==`` (for string values). The supported operators are:

* For numerical values:

  * ``=`` equal to or greater than. This is equivalent to ``>=`` and is
    supported for `legacy reasons <https://docs.openstack.org/nova/latest/user/filter-scheduler.html#filtering>`_
  * ``==`` equal to
  * ``!=`` not equal to
  * ``>=`` greater than or equal to
  * ``>`` greater than
  * ``<=`` less than or equal to
  * ``<`` less than

* For strings (as python comparisons):

  * ``s==`` equal to
  * ``s!=`` not equal to
  * ``s>=`` greater than or equal to
  * ``s>`` greater than
  * ``s<=`` less than or equal to
  * ``s<`` less than
  * ``<in>`` substring

* For collections:

  * ``<all-in>`` all elements contained in collection
  * ``<or>`` find one of these

Examples are:

* Finding a disk larger or equal to 60 GiB and non-rotational (SSD)::

    ironic node-update <node-uuid> add properties/root_device='{"size": ">= 60", "rotational": false}'

* Finding a disk whose vendor is ``samsung`` or ``winsys``::

    ironic node-update <node-uuid> add properties/root_device='{"vendor": "<or> samsung <or> winsys"}'

.. note::
    If multiple hints are specified, a device must satisfy all the hints.