Skip to content

Unable to stop instance with Local SSD attachedΒ #26173

@pratheekrebala

Description

@pratheekrebala

Community Note

  • Please vote on this issue by adding a πŸ‘ reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to a user, that user is claiming responsibility for the issue.
  • Customers working with a Google Technical Account Manager or Customer Engineer can ask them to reach out internally to expedite investigation and resolution of this issue.

Terraform Version & Provider Version(s)

Terraform v1.14.5
on darwin_arm64

  • provider registry.terraform.io/hashicorp/google v7.20.0

Affected Resource(s)

google_compute_instance

Terraform Configuration

resource "google_compute_instance" "repro" {
  name         = "local-ssd-stop-repro"
  machine_type = "n2-standard-2"

  desired_status = "RUNNING"

  boot_disk {
    initialize_params {
      image = "debian-cloud/debian-12"
      size  = 20
    }
  }

  scratch_disk {
    interface = "NVME"
  }

  network_interface {
    network = "default"
    access_config {}
  }

  scheduling {
    instance_termination_action = "STOP"
    on_instance_stop_action {
      discard_local_ssd = true
    }
  }
}

Debug Output

No response

Expected Behavior

We should be able to stop an instance with a Local SSD because on_instance_stop_action.discard_local_ssd is set.

Actual Behavior

I receive the following error:

β”‚ Error: googleapi: Error 400: VM has a Local SSD attached but an undefined value for `discard-local-ssd`. If using gcloud, please add `--discard-local-ssd=false` or `--discard-local-ssd=true` to your command., badRequest
β”‚ 
β”‚   with module.ingest-vm.google_compute_instance.ingest-vm,
β”‚   on ../../modules/ingest-vm/instance.tf line 1, in resource "google_compute_instance" "ingest-vm":
β”‚    1: resource "google_compute_instance" "ingest-vm" {

Steps to reproduce

  1. terraform apply
  2. Change desired_status to TERMINATED
  3. terraform apply

Important Factoids

I believe we might have to add a discardLocalSsd=true query parameter to the POST request.

References

No response

b/486166322

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions