Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to change scheduling policy - automatic_restart #1775

Closed
kuja53 opened this issue Jul 16, 2018 · 1 comment
Closed

Unable to change scheduling policy - automatic_restart #1775

kuja53 opened this issue Jul 16, 2018 · 1 comment
Assignees
Labels

Comments

@kuja53
Copy link

kuja53 commented Jul 16, 2018

On terraform 0.11.7 I try to change scheduling policy to not auto restart my VPS on GCE.

I'm using this in my affected module:

  count         = "${var.server_count}"
  name          = "${var.instance}-imf-${var.bbb_id}-${count.index}"
  project       = "${var.project}"
  machine_type  = "${var.server_type}"
  zone          = "${var.zone}"
  min_cpu_platform = "Intel Skylake"

  scheduling {
    automatic_restart   = "false"
    on_host_maintenance = "MIGRATE"
  }

When I run terraform apply on specific target which is affected it seems that everything is ok but finally default value "true" is still present in gcloud.

terraform apply output:


terraform apply -target module.aaa-bbb-c.google_compute_instance.bbb
google_compute_disk.bbb-boot: Refreshing state... (ID: aaa-bbb-c-0-boot)
google_compute_disk.bbb-data: Refreshing state... (ID: aaa-bbb-c-0-data)
google_compute_network.cloud-internal-netwrok: Refreshing state... (ID: cloud-internal-netwrok)
google_compute_subnetwork.cloud-internal-europe-west1: Refreshing state... (ID: europe-west1/cloud-internal-europe-west1)
google_compute_address.bbb-internal: Refreshing state... (ID: projects/abcd/regions/europe-west1/addresses/aaa-bbb-c-internal-0)
google_compute_instance.imf: Refreshing state... (ID: aaa-bbb-c-0)

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  ~ module.syg-imf-c.google_compute_instance.imf
      scheduling.0.automatic_restart: "true" => "false"


Plan: 0 to add, 1 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

module.aaa-bbb-c.google_compute_instance.bbb: Modifying... (ID: aaa-bbb-c-0)
  scheduling.0.automatic_restart: "true" => "false"
module.aaa-bbb-c.google_compute_instance.bbb: Still modifying... (ID: aaa-bbb-c-0, 10s elapsed)
module.aaa-bbb-c.google_compute_instance.bbb: Modifications complete after 12s (ID: aaa-bbb-c-0)

Apply complete! Resources: 0 added, 1 changed, 0 destroyed.

gcloud describe command is still the same:

scheduling:
  automaticRestart: true
  onHostMaintenance: MIGRATE
  preemptible: false

But when I change it manually in this case terraform see the change.

@ghost
Copy link

ghost commented Nov 17, 2018

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Nov 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants