set_drs_rule_enabled
Enable or disable an existing DRS rule with a preview before applying. Use it to temporarily turn off anti-affinity rules when a cluster is undersized, then re-enable when hosts return.
Instructions
[WRITE] Enable or disable an existing DRS rule - preview/confirm gated.
The day-2 toggle: anti-affinity rules often must be disabled while a cluster is temporarily too small to satisfy them, then re-enabled when hosts return. Idempotent - matching state returns a noop, no write. Names are matched exactly; ambiguous names refuse. Audited.
Returns: Preview dict (action="preview"), noop dict (action="noop"), or result dict (action="set", rule_now). Errors return "error" + hint.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | No | vCenter target name from config.yaml; omit to use the default target. | |
| cluster | Yes | Exact cluster name. | |
| confirm | No | False (default) returns the blast radius and changes nothing. True applies it. Do not set True because the user asked earlier; they have not seen the preview yet. | |
| enabled | Yes | True enables the rule; False disables it. | |
| rule_name | Yes | Exact rule name (see list_drs_rules). |