From aabc821119bf5600501281e0c38a388e0f100648 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Fri, 10 Nov 2023 13:57:01 -0500 Subject: [PATCH 1/2] builder: fix local SSD acceptance tests The acceptance tests for the builder that involve local SSDs don't work on E2 instances anymore. The documentation on GCE has been updated, and so are those tests, to an N2 instance, which allows extra local SSDs to be attached. --- builder/googlecompute/testdata/extra_scratch_disk.pkr.hcl | 1 + builder/googlecompute/testdata/multiple_disks.pkr.hcl | 1 + 2 files changed, 2 insertions(+) diff --git a/builder/googlecompute/testdata/extra_scratch_disk.pkr.hcl b/builder/googlecompute/testdata/extra_scratch_disk.pkr.hcl index 1e1fc3cc..232025a6 100644 --- a/builder/googlecompute/testdata/extra_scratch_disk.pkr.hcl +++ b/builder/googlecompute/testdata/extra_scratch_disk.pkr.hcl @@ -30,6 +30,7 @@ source "googlecompute" "test" { source_image_family = "centos-7" ssh_username = var.ssh_username skip_create_image = true + machine_type = "n2-standard-2" zone = var.zone disk_attachment { attachment_mode = "READ_WRITE" diff --git a/builder/googlecompute/testdata/multiple_disks.pkr.hcl b/builder/googlecompute/testdata/multiple_disks.pkr.hcl index 64146d80..e3a6ef66 100644 --- a/builder/googlecompute/testdata/multiple_disks.pkr.hcl +++ b/builder/googlecompute/testdata/multiple_disks.pkr.hcl @@ -30,6 +30,7 @@ source "googlecompute" "test" { source_image_family = "centos-7" ssh_username = var.ssh_username skip_create_image = true + machine_type = "n2-standard-2" zone = var.zone disk_attachment { From 5a32979b11aea535c387499d3d0c05ecb76aafc6 Mon Sep 17 00:00:00 2001 From: Lucas Bajolet Date: Fri, 10 Nov 2023 14:06:52 -0500 Subject: [PATCH 2/2] docs: update local extra disk docs on local SSDs Local SSDs are not available for all the instance types, so we call that out in the docs, and add a link to the official documentation on that subject. --- .web-docs/components/builder/googlecompute/README.md | 4 ++++ builder/googlecompute/config.go | 4 ++++ docs-partials/builder/googlecompute/Config-not-required.mdx | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/.web-docs/components/builder/googlecompute/README.md b/.web-docs/components/builder/googlecompute/README.md index ed90e120..85cefe9c 100644 --- a/.web-docs/components/builder/googlecompute/README.md +++ b/.web-docs/components/builder/googlecompute/README.md @@ -129,6 +129,10 @@ builder. Scratch (ephemeral) SSDs are always created at launch, and deleted when the instance is torn-down. + Note: local SSDs are not supported on all machine types, refer to the + [docs](https://cloud.google.com/compute/docs/disks/local-ssd#choose_number_local_ssds) + for more information on that. + Refer to the [Extra Disk Attachments](#extra-disk-attachments) section for more information on this configuration type. diff --git a/builder/googlecompute/config.go b/builder/googlecompute/config.go index 23d99310..c9018136 100644 --- a/builder/googlecompute/config.go +++ b/builder/googlecompute/config.go @@ -116,6 +116,10 @@ type Config struct { // Scratch (ephemeral) SSDs are always created at launch, and deleted when the // instance is torn-down. // + // Note: local SSDs are not supported on all machine types, refer to the + // [docs](https://cloud.google.com/compute/docs/disks/local-ssd#choose_number_local_ssds) + // for more information on that. + // // Refer to the [Extra Disk Attachments](#extra-disk-attachments) section for // more information on this configuration type. ExtraBlockDevices []BlockDevice `mapstructure:"disk_attachment" required:"false"` diff --git a/docs-partials/builder/googlecompute/Config-not-required.mdx b/docs-partials/builder/googlecompute/Config-not-required.mdx index 2b83b6c1..c46b88c4 100644 --- a/docs-partials/builder/googlecompute/Config-not-required.mdx +++ b/docs-partials/builder/googlecompute/Config-not-required.mdx @@ -81,6 +81,10 @@ Scratch (ephemeral) SSDs are always created at launch, and deleted when the instance is torn-down. + Note: local SSDs are not supported on all machine types, refer to the + [docs](https://cloud.google.com/compute/docs/disks/local-ssd#choose_number_local_ssds) + for more information on that. + Refer to the [Extra Disk Attachments](#extra-disk-attachments) section for more information on this configuration type.