@@ -721,7 +721,7 @@ func TestAccComputeInstance_bootDisk_mode(t *testing.T) {
721
721
})
722
722
}
723
723
724
- func TestAccComputeInstance_scratchDisk (t * testing.T ) {
724
+ func TestAccComputeInstance_with375GbScratchDisk (t * testing.T ) {
725
725
t .Parallel ()
726
726
727
727
var instance compute.Instance
@@ -733,7 +733,7 @@ func TestAccComputeInstance_scratchDisk(t *testing.T) {
733
733
CheckDestroy : testAccCheckComputeInstanceDestroyProducer (t ),
734
734
Steps : []resource.TestStep {
735
735
{
736
- Config : testAccComputeInstance_scratchDisk (instanceName ),
736
+ Config : testAccComputeInstance_with375GbScratchDisk (instanceName ),
737
737
Check : resource .ComposeTestCheckFunc (
738
738
testAccCheckComputeInstanceExists (
739
739
t , "google_compute_instance.foobar" , & instance ),
@@ -745,6 +745,33 @@ func TestAccComputeInstance_scratchDisk(t *testing.T) {
745
745
})
746
746
}
747
747
748
+ func TestAccComputeInstance_with18TbScratchDisk (t * testing.T ) {
749
+ // Skip this test until the quota for the GitHub presubmit GCP project is increased
750
+ // to handle the size of the resource this test spins up.
751
+ t .Skip ()
752
+ t .Parallel ()
753
+
754
+ var instance compute.Instance
755
+ var instanceName = fmt .Sprintf ("tf-test-%s" , RandString (t , 10 ))
756
+
757
+ VcrTest (t , resource.TestCase {
758
+ PreCheck : func () { testAccPreCheck (t ) },
759
+ ProtoV5ProviderFactories : ProtoV5ProviderFactories (t ),
760
+ CheckDestroy : testAccCheckComputeInstanceDestroyProducer (t ),
761
+ Steps : []resource.TestStep {
762
+ {
763
+ Config : testAccComputeInstance_with18TbScratchDisk (instanceName ),
764
+ Check : resource .ComposeTestCheckFunc (
765
+ testAccCheckComputeInstanceExists (
766
+ t , "google_compute_instance.foobar" , & instance ),
767
+ testAccCheckComputeInstanceScratchDisk (& instance , []string {"NVME" , "NVME" , "NVME" , "NVME" , "NVME" , "NVME" }),
768
+ ),
769
+ },
770
+ computeInstanceImportStep ("us-central1-a" , instanceName , []string {}),
771
+ },
772
+ })
773
+ }
774
+
748
775
func TestAccComputeInstance_forceNewAndChangeMetadata (t * testing.T ) {
749
776
t .Parallel ()
750
777
@@ -4389,7 +4416,7 @@ resource "google_compute_instance" "foobar" {
4389
4416
` , instance , diskMode )
4390
4417
}
4391
4418
4392
- func testAccComputeInstance_scratchDisk (instance string ) string {
4419
+ func testAccComputeInstance_with375GbScratchDisk (instance string ) string {
4393
4420
return fmt .Sprintf (`
4394
4421
data "google_compute_image" "my_image" {
4395
4422
family = "debian-11"
@@ -4422,6 +4449,60 @@ resource "google_compute_instance" "foobar" {
4422
4449
` , instance )
4423
4450
}
4424
4451
4452
+ func testAccComputeInstance_with18TbScratchDisk (instance string ) string {
4453
+ return fmt .Sprintf (`
4454
+ data "google_compute_image" "my_image" {
4455
+ family = "debian-11"
4456
+ project = "debian-cloud"
4457
+ }
4458
+
4459
+ resource "google_compute_instance" "foobar" {
4460
+ name = "%s"
4461
+ machine_type = "n2-standard-64" // must be a large n2 to be paired with 18Tb local-ssd
4462
+ zone = "us-central1-a"
4463
+
4464
+ boot_disk {
4465
+ initialize_params {
4466
+ image = data.google_compute_image.my_image.self_link
4467
+ }
4468
+ }
4469
+
4470
+ scratch_disk {
4471
+ interface = "NVME"
4472
+ size = 3000
4473
+ }
4474
+
4475
+ scratch_disk {
4476
+ interface = "NVME"
4477
+ size = 3000
4478
+ }
4479
+
4480
+ scratch_disk {
4481
+ interface = "NVME"
4482
+ size = 3000
4483
+ }
4484
+
4485
+ scratch_disk {
4486
+ interface = "NVME"
4487
+ size = 3000
4488
+ }
4489
+
4490
+ scratch_disk {
4491
+ interface = "NVME"
4492
+ size = 3000
4493
+ }
4494
+
4495
+ scratch_disk {
4496
+ interface = "NVME"
4497
+ size = 3000
4498
+ }
4499
+
4500
+ network_interface {
4501
+ network = "default"
4502
+ }
4503
+ }` , instance )
4504
+ }
4505
+
4425
4506
func testAccComputeInstance_serviceAccount (instance string ) string {
4426
4507
return fmt .Sprintf (`
4427
4508
data "google_compute_image" "my_image" {
0 commit comments