vSphere metadata becomes operational infrastructure once automation depends on it.
Tags and custom attributes are useful because they make inventory searchable and machine-readable. They are risky when teams treat them as decoration. If Terraform, NetBox sync jobs, backup tools, or reports use a tag, that tag is an API contract.
Tags Versus Custom Attributes
Use tags for categorical membership:
- environment.
- workload class.
- backup policy.
- lifecycle state.
- automation owner.
- Kubernetes cluster or platform grouping.
Use custom attributes for small pieces of descriptive data:
- cost center.
- service owner.
- support queue.
- external inventory ID.
- migration batch.
Do not encode everything into names. Names are for humans. Metadata is for search, reports, and automation decisions.
Ownership Matters
Every automation-consumed category needs an owner.
Record:
category name
allowed values
cardinality policy
who may change it
which tools consume it
what breaks if it is wrong
review cadence
Cardinality matters. A VM should usually have one lifecycle state, one environment, and one backup policy. If a category allows multiple values, document why.
Automation Contracts
Common consumers include:
- Terraform modules selecting or annotating VMs.
- NetBox inventory sync and audit jobs.
- backup policy assignment.
- maintenance targeting.
- cost or capacity reporting.
- Kubernetes node grouping and replacement workflows.
If a tag drives action, validate it before mutation.
For example:
read inventory -> verify tag category exists -> verify allowed value
-> show affected VMs -> mutate only reviewed targets
The same rule applies to custom attributes. Automation should fail closed when required metadata is missing or ambiguous.
Metadata Hygiene Checks
Run periodic reviews for:
- VMs missing required tags.
- VMs with conflicting lifecycle or backup tags.
- unused tag values that no tool recognizes.
- tags scoped to the wrong object type.
- custom attributes populated with stale owner data.
- automation accounts with permission to change metadata they only need to read.
Metadata drift is infrastructure drift. It just fails later.
Failure Model
The common failure is not a bad tag. It is unowned meaning:
tag created -> automation consumes it -> value changes manually
-> reports or backup selection drift -> incident review cannot explain why
The VM still runs. The control plane around it becomes unreliable.
The operating rule: if automation reads vSphere metadata, own it like code.