Merge "Add disk root device hints"

This commit is contained in:
Jenkins 2017-02-28 15:10:52 +00:00 committed by Gerrit Code Review
commit 3728386c0c
5 changed files with 63 additions and 0 deletions

View 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.

View File

@ -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

View File

@ -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)
- step_introspect_with_retry: <false> -- a more robust version of the step_introspect option

View File

@ -12,6 +12,8 @@ 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
download_overcloud_image: false

View File

@ -97,6 +97,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 %}