gcp.compute.vm.ensure ​
Create or resolve a GCE VM / MIG
Creates a GCE VM (or Managed Instance Group, per LTIP's compute.vm abstraction) if it does not exist. When present, describes and returns the existing resource.
Inputs:
- connection_uuid: Cloud connection UUID (required)
- name: VM / MIG name (required)
- zone: GCE zone, e.g. "us-central1-a" (required; "region" is a deprecated alias)
- instance_type: e.g. "e2-medium" (required)
- cpu: vCPU count (optional)
- memory_gb: Memory in GiB (optional)
- image: OS image (optional)
- startup_script: Startup script string (optional)
- metadata: Dict (optional)
- project_id: Explicit project (optional)
Outputs:
- name
- region
- provider_resource_id
- existed: bool
Overview ​
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | Base-gcp |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
connection_uuid | uuid | Yes | — | — |
name | string | Yes | — | — |
zone | string | No | — | GCE zone, e.g. 'us-central1-a'. Required (may be supplied via the 'region' alias). |
region | string | No | — | Deprecated alias for 'zone'. A bare region (e.g. 'us-central1') is NOT a valid zone. |
instance_type | string | Yes | — | — |
cpu | integer | No | — | — |
memory_gb | integer | No | — | — |
image | string | No | — | — |
startup_script | string | No | — | — |
metadata | json | No | — | — |
project_id | string | No | — | — |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
existed | boolean | No | — | — |
name | string | No | — | — |
project_id | string | No | — | — |
provider_resource_id | string | No | — | — |
zone | string | No | — | — |
region | string | No | — | — |
connection_uuid | uuid | No | — | — |
cpu | integer | No | — | — |
image | string | No | — | — |
instance_type | string | No | — | — |
memory_gb | integer | No | — | — |
metadata | json | No | — | — |
startup_script | string | No | — | — |
failure_reason | string | No | — | — |
failure_type | string | No | — | — |
failed_action | string | No | — | — |
failed_at_state | string | No | — | — |
failed_step | string | No | — | — |
failed_layer | string | No | — | — |
error | string | No | — | — |
error_type | string | No | — | — |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
pending | Yes | No | — | execute | — |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | execute | completed | — |
* (any state) | fail | failed | — |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "gcp.compute.vm.ensure",
"initial_data": {
"connection_uuid": "value",
"name": "value",
"instance_type": "value"
}
}