diff --git a/releasenotes/notes/root-device-hints-a8a6e41ec851ec12.yaml b/releasenotes/notes/root-device-hints-a8a6e41ec851ec12.yaml new file mode 100644 index 000000000..a53231bd5 --- /dev/null +++ b/releasenotes/notes/root-device-hints-a8a6e41ec851ec12.yaml @@ -0,0 +1,21 @@ +--- +features: + - Added the possibility to give root device hints + for nodes, covering the same type of hints as + Ironic allows. +deprecations: + - Currently only support for disk size hint was possible + on OOOQ. This was using the ``disk_root_device_size`` + setting, as well as the disk property on instackenv.json + This feature is not being removed, but the usage of new + root device hintes feature is prefered. If some device + hints are given using this new env setting, the old + way will be ignored. + In the future, ``disk_root_device_size`` hint will need + to be deprecated. +fixes: + - Currently OOOQ deploys on baremetal, on servers with multiple + disks, is not behaving correctly. There was the possibility + of giving root device hints, but only based on size. On systems + where the disk size was the same, it was impossible to target + the right disk. diff --git a/roles/collect-logs/docs/static/baremetal-overcloud/env-specific-pre-deploy-steps.rst b/roles/collect-logs/docs/static/baremetal-overcloud/env-specific-pre-deploy-steps.rst index a9fbcae97..1b95ec79f 100644 --- a/roles/collect-logs/docs/static/baremetal-overcloud/env-specific-pre-deploy-steps.rst +++ b/roles/collect-logs/docs/static/baremetal-overcloud/env-specific-pre-deploy-steps.rst @@ -10,6 +10,7 @@ that can be set per environment. Some examples of additional steps are: - Adding disk size hints +- Adding disk hints per node, supporting all Ironic hints - Adjusting MTU values - Rerunning introspection on failure diff --git a/roles/overcloud-prep-images/README.md b/roles/overcloud-prep-images/README.md index 52e2f70e3..e2bf72289 100644 --- a/roles/overcloud-prep-images/README.md +++ b/roles/overcloud-prep-images/README.md @@ -19,6 +19,19 @@ Role Variables - undercloud_type: -- can be overwritten with values like 'baremetal' or 'ovb' - step_root_device_size: -- add disk size hints if needed for the environment under test - disk_root_device_size: <1843> -- size hint for selecting the correct disk during introspection +- step_root_device_hints: false -- add root device hints if needed for the environment under test +- root_device_hints: [] -- list of the root device hints to be associated with nodes. Needs to have this format:: + + - root_device_hints: + - ip: <> + key: <> + value: <> + + Where key needs to be one of the valid Ironic root device hints, and value is the exact value that needs to be filtered. + For reference on all the possible root device hints see ``http://docs.openstack.org/project-install-guide/baremetal/draft/advanced.html#specifying-the-disk-for-deployment-root-device-hints``. + Please note that in order to match root device hints with the associated nodes on `instackenv.json`, + the node `pm_address` will be used as a key. + At the moment only equal operator is supported, is not possible to use other operators or logical combinations. - whole_disk_images: false -- shows if we want to use partition or whole disk images (this will be available starting on Ocata) Dependencies diff --git a/roles/overcloud-prep-images/defaults/main.yml b/roles/overcloud-prep-images/defaults/main.yml index 1c0924897..80bf07311 100644 --- a/roles/overcloud-prep-images/defaults/main.yml +++ b/roles/overcloud-prep-images/defaults/main.yml @@ -11,4 +11,6 @@ bash_deploy_ramdisk: false step_install_undercloud: true step_root_device_size: false disk_root_device_size: 1843 +step_root_device_hints: false +root_device_hints: [] whole_disk_images: false diff --git a/roles/overcloud-prep-images/templates/overcloud-prep-images.sh.j2 b/roles/overcloud-prep-images/templates/overcloud-prep-images.sh.j2 index 4d096f17c..5445b4741 100644 --- a/roles/overcloud-prep-images/templates/overcloud-prep-images.sh.j2 +++ b/roles/overcloud-prep-images/templates/overcloud-prep-images.sh.j2 @@ -84,6 +84,32 @@ sudo mistral-db-manage populate {% endif %} +{% if step_root_device_hints|bool %} +## * Get nodes UUID +## :: + +export ironic_nodes="$( ironic node-list | awk '/power/ {print $2}' )" + +for ironic_node in $ironic_nodes; do + # extract IP from ironic node details + ip_address=$(ironic node-show $ironic_node --fields driver_info | sed -n "s/.*ipmi_address': u'\([0-9\.]*\)'.*/\1/p") + + # get information for the matching template + {% for node in root_device_hints %} + NODE_IP="{{ node['ip'] }}" + if [ "$NODE_IP" == "$ip_address" ]; then + # set property + ironic node-update $ironic_node add properties/root_device='{"{{ node['key'] }}": "{{ node['value'] }}"}' + fi + {% endfor %} +done + +# Temporary step to avoid introspection failure +# Workaround for: https://bugs.launchpad.net/tripleo/+bug/1649350 +sudo mistral-db-manage populate + +{% endif %} + {% if step_introspect %}