vmware: Expose external customer traits #543
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With splitting up clusters into internal and external workloads using DRS HostGroups, we have to expose information to the scheduler which hosts can support external workloads. This could be done manually by adding the trait defined in
nova.utils.EXTERNAL_CUSTOMER_SUPPORTED_TRAIT
to hosts, but that seems cumbersome and error-prone. Therefore, we detect HostGroups automatically through a naming convention and, if we find some, expose appropriate traits for them.We expose traits per HostGroup so we can in the future also support customer-owned HVs where all VMs in a domain should only run on hosts dedicated to that customer. Having traits exposed for them allows us to filter in the scheduler.
We do not use the
DRS_PREFIX
for finding appropriate HostGroup objects, because these are managed by an external entity and not by Nova and thus should not be named with Nova's prefix.We refresh the HostGroups every time we refresh the cluster resources. We also save the HostGroups in the
VCState
's stats, so we can use them later on e.g. if we want to scheduler manually instead of via DRS and when checking which VmGroup a VM should be put to during spawning/migrating.Change-Id: Ic7da95442c99cc51798d3555325d477a0c4ce5ea