[PR #9787/e8e3e5c2 backport][stable-10] Allow Xen Host and/or Xen VM names instead of their UUIDs #9801
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.
This is a backport of PR #9787 as merged into main (e8e3e5c).
This is a redo of a previously closed PR where I messed up git rebase and figured it would be quicker to just make a new PR with a fresh branch.
( #9767 )
SUMMARY
Currently the inventory entry names are created exclusively using UUID's as the inventory items name.
Sometimes we would prefer to use the Host/VM names in the inventory so I've added some options to allow adding Hosts/VMs using their names (name_labels) instead of their UUIDs from Xen.
By default UUID's will be used just like how it currently exists.
If you set use_vm_uuids or use_host_uuids to false then names will be used instead.
WHY
Currently since every VM is using UUIDs this means you cannot use host patterns/limits for controlling where your jobs run (as far as I know) and you're stuck using flow controls from tags and other bits of metadata that need to be in your playbooks directly.
Another major benefit to this is if you're using AWX/Tower this will make your dynamic inventory much more easily searchable/usable.
With that in mind there is a glaringly obvious downside to using names which is duplicate names are possible with Xen so this may cause issues as this PR does not currently consider duplicate name handling though there is some logic to append a number count to any duplicate names to get around this.
ISSUE TYPE
Feature Pull Request
COMPONENT NAME
Xen Orchestra
EXAMPLE OUTPUT
pr-9787-xoa_allow_using_names_in_inventory.json