From 91e78e83307ee2bee2f44014066ba95b2e8438a2 Mon Sep 17 00:00:00 2001 From: David Montoya Date: Fri, 31 Oct 2025 12:07:46 -0500 Subject: [PATCH 1/2] feat: allow set disk size & type on vm runner --- modules/gh-runner-mig-container-vm/README.md | 2 ++ modules/gh-runner-mig-container-vm/main.tf | 4 ++-- modules/gh-runner-mig-container-vm/variables.tf | 12 ++++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/modules/gh-runner-mig-container-vm/README.md b/modules/gh-runner-mig-container-vm/README.md index ef0b0fb..4d5030e 100644 --- a/modules/gh-runner-mig-container-vm/README.md +++ b/modules/gh-runner-mig-container-vm/README.md @@ -30,6 +30,8 @@ This example shows how to deploy a Self Hosted Runner on MIG Container VMs. | cooldown\_period | The number of seconds that the autoscaler should wait before it starts collecting information from a new instance. | `number` | `60` | no | | create\_network | When set to true, VPC,router and NAT will be auto created | `bool` | `true` | no | | dind | Flag to determine whether to expose dockersock | `bool` | `false` | no | +| disk\_size\_gb | Instance disk size in GB | `number` | `100` | no | +| disk\_type | Instance disk type, can be either pd-ssd, local-ssd, or pd-standard | `string` | `"pd-ssd"` | no | | gh\_token | Github token that is used for generating Self Hosted Runner Token | `string` | n/a | yes | | image | The github runner image | `string` | n/a | yes | | instance\_name | The gce instance name | `string` | `"gh-runner"` | no | diff --git a/modules/gh-runner-mig-container-vm/main.tf b/modules/gh-runner-mig-container-vm/main.tf index 2b17f50..d4d2e22 100644 --- a/modules/gh-runner-mig-container-vm/main.tf +++ b/modules/gh-runner-mig-container-vm/main.tf @@ -163,8 +163,8 @@ module "mig_template" { "https://www.googleapis.com/auth/cloud-platform", ] } - disk_size_gb = 100 - disk_type = "pd-ssd" + disk_size_gb = var.disk_size_gb + disk_type = var.disk_type auto_delete = true name_prefix = "gh-runner" source_image_family = "cos-stable" diff --git a/modules/gh-runner-mig-container-vm/variables.tf b/modules/gh-runner-mig-container-vm/variables.tf index 462e036..c1d7bcc 100644 --- a/modules/gh-runner-mig-container-vm/variables.tf +++ b/modules/gh-runner-mig-container-vm/variables.tf @@ -131,3 +131,15 @@ variable "spot_instance_termination_action" { type = string default = "STOP" } + +variable "disk_size_gb" { + type = number + description = "Instance disk size in GB" + default = 100 +} + +variable "disk_type" { + type = string + description = "Instance disk type, can be either pd-ssd, local-ssd, or pd-standard" + default = "pd-ssd" +} From 346e77f9bb25e7ff79a199a196ff7a71ba41b29b Mon Sep 17 00:00:00 2001 From: David Montoya Date: Fri, 31 Oct 2025 12:12:49 -0500 Subject: [PATCH 2/2] feat: allow set disk size & type on vm runner --- modules/gh-runner-mig-vm/README.md | 2 ++ modules/gh-runner-mig-vm/main.tf | 4 ++-- modules/gh-runner-mig-vm/variables.tf | 12 ++++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/modules/gh-runner-mig-vm/README.md b/modules/gh-runner-mig-vm/README.md index f95dfd9..db04797 100644 --- a/modules/gh-runner-mig-vm/README.md +++ b/modules/gh-runner-mig-vm/README.md @@ -32,6 +32,8 @@ This example shows how to deploy a MIG Self Hosted Runner with an image pre-bake | create\_network | When set to true, VPC,router and NAT will be auto created | `bool` | `true` | no | | create\_subnetwork | Whether to create subnetwork or use the one provided via subnet\_name | `bool` | `true` | no | | custom\_metadata | User provided custom metadata | `map(any)` | `{}` | no | +| disk\_size\_gb | Instance disk size in GB | `number` | `100` | no | +| disk\_type | Instance disk type, can be either pd-ssd, local-ssd, or pd-standard | `string` | `"pd-ssd"` | no | | gh\_runner\_labels | GitHub runner labels to attach to the runners. Docs: https://docs.github.com/en/actions/hosting-your-own-runners/using-labels-with-self-hosted-runners | `set(string)` | `[]` | no | | gh\_token | Github token that is used for generating Self Hosted Runner Token | `string` | n/a | yes | | instance\_tags | Additional tags to add to the instances | `list(string)` | `[]` | no | diff --git a/modules/gh-runner-mig-vm/main.tf b/modules/gh-runner-mig-vm/main.tf index ddd6dc6..baad372 100644 --- a/modules/gh-runner-mig-vm/main.tf +++ b/modules/gh-runner-mig-vm/main.tf @@ -132,8 +132,8 @@ module "mig_template" { "https://www.googleapis.com/auth/cloud-platform", ] } - disk_size_gb = 100 - disk_type = "pd-ssd" + disk_size_gb = var.disk_size_gb + disk_type = var.disk_type auto_delete = true name_prefix = "gh-runner" source_image_family = var.source_image_family diff --git a/modules/gh-runner-mig-vm/variables.tf b/modules/gh-runner-mig-vm/variables.tf index 636fdbd..630e656 100644 --- a/modules/gh-runner-mig-vm/variables.tf +++ b/modules/gh-runner-mig-vm/variables.tf @@ -165,3 +165,15 @@ variable "spot_instance_termination_action" { type = string default = "STOP" } + +variable "disk_size_gb" { + type = number + description = "Instance disk size in GB" + default = 100 +} + +variable "disk_type" { + type = string + description = "Instance disk type, can be either pd-ssd, local-ssd, or pd-standard" + default = "pd-ssd" +}