Skip to content

Instantly share code, notes, and snippets.

@ThinGuy
Last active March 6, 2018 05:48
Show Gist options
  • Save ThinGuy/143f373d09ad1caeaf41acb55c97c7b9 to your computer and use it in GitHub Desktop.
Save ThinGuy/143f373d09ad1caeaf41acb55c97c7b9 to your computer and use it in GitHub Desktop.
Hypervisor / Pod Host XPATH auto-tagging for MaaS
maas ${MAAS_PROFILE} tags create name=pod-host \
definition='//node[@id="memory" and @class="memory"]/size >= "17179860388" and
//node[@id="cpu" and @class="processor"]/configuration/setting/id="cores" >= 2 and
.//node[@id="cpu"]/capabilities/capability[@id="vmx"] and
.//node[@id="cpu"]/capabilities/capability[@id="aes"] and
.//node[@id="cpu"]/capabilities/capability[@id="ept"] and
.//node[@id="cpu"]/capabilities/capability[@id="vpid"] and
.//node[@id="cpu"]/capabilities/capability[@id="tpr_shadow"] and
.//node[@id="cpu"]/capabilities/capability[@id="flexpriority"] and
.//node[@id="cpu"]/capabilities/capability[@id="vnmi"]' \
comment='MaaS auto xpath auto-tag for that checks for:
# - Certain amount (>=16GB) of RAM ( value in Bytes)
# - Certain number (>=2) of cores
# - CPU support for key Intel Virtualization Features:
# - - vmx: Intel hardware virtualization
# - - aes: Hardware encryption
# - - ept: Intel extended page table support enabled to make emulation of guest page tables faster.
# - - vpid: Intel virtual processor ID. Make expensive TLB flushes unnecessary when context switching between guests.
# - - tpr_shadow and flexpriority: Intel features that reduces calls into the hypervisor when accessing the Task Priority Register, which helps SMP guests.
# - - vnmi: Intel Virtual NMI helps with selected interrupt events in guests.
# If all are met then it gets tagged with pod-host'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment