Skip to content

Commit

Permalink
[IA-5035] Deploy a GCE VM with WSM (#1782)
Browse files Browse the repository at this point in the history
* GCE VM boot disk size parameter

* Add leonardo tag to list

* Revert "Add leonardo tag to list"

This reverts commit ed29cf3.

* Spotless and comment

* GCE vmImage is required
  • Loading branch information
rtitle authored Aug 13, 2024
1 parent 12ce8ac commit d7de27e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
18 changes: 12 additions & 6 deletions openapi/src/parts/controlled_gcp_gce_instance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ paths:
$ref: '#/components/responses/ServerError'
post:
summary: |
Delete a controlled GCP GCE instance resource. This is async,
because the operation can take ~5 minutes. OpenAPI does not support
Delete a controlled GCP GCE instance resource. This is async,
because the operation can take ~5 minutes. OpenAPI does not support
request body in DELETE, but async state requires it. Hence this is a POST.
operationId: deleteGceInstance
tags: [ ControlledGcpResource ]
Expand Down Expand Up @@ -179,7 +179,7 @@ components:
GCE instance specific properties to be set on creation. These are a subset of the
values accepted by the GCP Compute API. See https://cloud.google.com/compute/docs/reference/rest/v1/instances/insert
type: object
required: [ machineType ]
required: [ machineType, vmImage ]
properties:
instanceId:
description: >-
Expand Down Expand Up @@ -222,6 +222,12 @@ components:
of 64000 GB (64 TB). If not specified, this defaults to 500.
type: integer
format: int64
bootDiskSizeGb:
description: >-
The size of the boot disk in GB attached to this instance. If not specified, defaults to
the size of the vmImage.
type: integer
format: int64

GcpGceInstanceGuestAccelerator:
description: >-
Expand Down Expand Up @@ -258,8 +264,8 @@ components:
properties:
metadata:
description: >-
A map of custom metadata to apply to this instance. Some metadata
keys are reserved by Terra and will throw a bad request error if
A map of custom metadata to apply to this instance. Some metadata
keys are reserved by Terra and will throw a bad request error if
specified: 'terra-workspace-id', 'terra-cli-server'.
type: object
additionalProperties:
Expand Down Expand Up @@ -293,7 +299,7 @@ components:
instanceName:
type: string

responses:
responses:
CreatedControlledGcpGceInstanceResponse:
description: Response to Create controlled resource
content:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,14 +196,16 @@ static Instance setFields(
.setInitializeParams(
new AttachedDiskInitializeParams()
.setSourceImage(creationParameters.getVmImage())
.setDiskSizeGb(100L)),
// If null, defaults to the size of the source image
.setDiskSizeGb(creationParameters.getBootDiskSizeGb())),
new AttachedDisk()
.setBoot(false)
.setDeviceName(DATA_DISK_NAME)
.setAutoDelete(true)
.setInitializeParams(
new AttachedDiskInitializeParams()
.setDiskType(creationParameters.getDataDiskType())
// If null, defaults to 500G
.setDiskSizeGb(creationParameters.getDataDiskSizeGb()))));

instance.setServiceAccounts(
Expand Down

0 comments on commit d7de27e

Please sign in to comment.