Add disk root device hints
It currently just supported disk hints by size. Add the possibility to give root device hints by any or the ironic supported properties. Change-Id: Ifcca245b67077a903fca5dac8f1cb73b6423cf6c
This commit is contained in:
parent
a417c25f47
commit
75f5b56ad4
21
releasenotes/notes/root-device-hints-a8a6e41ec851ec12.yaml
Normal file
21
releasenotes/notes/root-device-hints-a8a6e41ec851ec12.yaml
Normal file
@ -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.
|
@ -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
|
||||
|
||||
|
@ -19,6 +19,19 @@ Role Variables
|
||||
- undercloud_type: <virtual> -- can be overwritten with values like 'baremetal' or 'ovb'
|
||||
- step_root_device_size: <false> -- 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: <<pm_addr>>
|
||||
key: <<string>>
|
||||
value: <<string>>
|
||||
|
||||
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
|
||||
|
@ -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
|
||||
|
@ -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 %}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user