remove_instances
Remove instances from an Ocean cluster using a chosen strategy: drain_and_replace for graceful pod draining, replace for immediate termination with auto-replacement, or remove_permanently to reduce capacity. Requires confirm=true.
Instructions
DESTRUCTIVE: Remove instances from an Ocean cluster using a named strategy. This is the RECOMMENDED tool for instance removal — it picks the right API call for you. Requires confirm=true.
Strategies:
"drain_and_replace": Gracefully drain pods (respects PDBs), terminate, Ocean replaces. Uses rolling restart. SAFEST option for production. (Default if not specified)
"replace": Immediately terminate instances, Ocean auto-scales replacements. Faster but no graceful drain — pods are killed abruptly.
"remove_permanently": Terminate instances AND reduce cluster capacity. Instances are gone and NOT replaced. Use for downsizing.
Args: cluster_id: The Ocean cluster ID (e.g. o-abc12345) instance_ids: Comma-separated instance IDs (e.g. i-abc123,i-def456) strategy: One of: drain_and_replace, replace, remove_permanently confirm: Must be true to execute. Safety guard. batch_size_percentage: For drain_and_replace only: % of nodes per batch (default: 20) account_id: Optional account ID. Defaults to SPOTINST_ACCOUNT_ID env var. cloud: Cloud provider: aws or azure (default: aws). Note: replace and remove_permanently are AWS-only.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cluster_id | Yes | ||
| instance_ids | Yes | ||
| strategy | No | ||
| confirm | No | ||
| batch_size_percentage | No | ||
| account_id | No | ||
| cloud | No | aws |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |