Allow excluding image type capabilities

During the implementation of blueprint request-filter-image-types,
I left a FIXME to follow-up and add an ability for an operator to
configure compute nodes to not expose image formats that they *can*
support, for situations where they may not be desired. Consider a
remote compute node which *can* support raw images, but for which
you want to require that the user use qcow2 for transfer efficiency.

This adds a new compute-level config option which allows excluding
image types, which will be filtered out of the traits list in a
general way, to avoid having to honor the list in each driver.

Change-Id: Iabe6246dba212b1a287a82cc0cf16e2e8c8a24b8
This commit is contained in:
Dan Smith
2020-10-07 08:15:47 -07:00
parent 2745e68537
commit cf0e519a0e
5 changed files with 62 additions and 5 deletions

View File

@@ -979,6 +979,27 @@ Additional documentation is available here:
https://docs.openstack.org/nova/latest/admin/managing-resource-providers.html
"""),
cfg.ListOpt('image_type_exclude_list',
default=[],
help="""
A list of image formats that should not be advertised as supported by this
compute node.
In some situations, it may be desirable to have a compute node
refuse to support an expensive or complex image format. This factors into
the decisions made by the scheduler about which compute node to select when
booted with a given image.
Possible values:
* Any glance image ``disk_format`` name (i.e. ``raw``, ``qcow2``, etc)
Related options:
* ``[scheduler]query_placement_for_image_type_support`` - enables
filtering computes based on supported image types, which is required
to be enabled for this to take effect.
"""),
]