apply_vm_tag
Apply an NSX tag to a virtual machine using its VM ID, tag scope, and tag value. The operation is additive, preserving existing tags, and returns the applied tag for verification.
Instructions
[WRITE] Apply an NSX tag to a virtual machine.
Returns {"status": "applied", "vm_id", "scope", "tag"} — not the VM's tag list. Use list_vm_tags first for the vm_id, and again after to see the result. Additive, so existing tags survive, but note that tag-based group membership shifts as NSX re-evaluates: check with get_group.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| vm_id | Yes | VM external ID (fabric UUID, from list_vm_tags). | |
| target | No | Optional NSX Manager target from config. | |
| tag_scope | Yes | Tag scope (e.g. 'env', 'tier', 'owner'). | |
| tag_value | Yes | Tag value (e.g. 'production', 'web'). |