Ironic already has support for automatically setting a lessee on deployment, but it is only supported for direct deployments with Ironic, as it uses request context which is not preserved in the Nova driver. Now, when combined with the related Nova change, Ironic can support this behavior for fully integrated installations. On deploy time, Nova will set several fields -- including project_id -- in instance info. If enabled, Ironic will then use that project_id as the automatic lessee. The previous behavior of using the project_id from the request context is still supported as a fallback. This is being tracked in nova as blueprint ironic-guest-metadata. Closes-Bug: #2063352 Change-Id: Id381a3d201c2f1b137279decc0e32096d4d95012
29 lines
875 B
Python
29 lines
875 B
Python
# All Rights Reserved.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
# not use this file except in compliance with the License. You may obtain
|
|
# a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
# License for the specific language governing permissions and limitations
|
|
# under the License.
|
|
|
|
|
|
"""
|
|
Mapping of values for CONF.conductor.automatic_lessee_source, representing
|
|
different possible sources for lessee data.
|
|
"""
|
|
|
|
NONE = 'none'
|
|
"Do not set lessee"
|
|
|
|
REQUEST = 'request'
|
|
"Use metadata in request context"
|
|
|
|
INSTANCE = 'instance'
|
|
"Use instance_info[\'project_id\']"
|