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

reservation_affinity = null should be the same as "ANY_RESERVATION" #9449

Closed
dex4er opened this issue Jun 28, 2021 · 2 comments · Fixed by GoogleCloudPlatform/magic-modules#4926, #9460 or hashicorp/terraform-provider-google-beta#3389
Assignees
Labels

Comments

@dex4er
Copy link

dex4er commented Jun 28, 2021

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 the modular-magician user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to hashibot, a community member has claimed the issue already.

Terraform Version

Terraform v1.0.1
on linux_amd64

  • provider registry.terraform.io/hashicorp/google v3.73.0
  • provider registry.terraform.io/hashicorp/google-beta v3.73.0

Affected Resource(s)

  • google_compute_instance

Actual Behavior

After #9256 my VMs are going to be recreated because this PR introduced reservation_affinity value. The documentation https://cloud.google.com/kubernetes-engine/docs/how-to/consuming-reservations#consuming_reserved_instances_in says the default value is "ANY_RESERVATION" so it should be the same as null.

My plan after upgrade of the google provider:

Terraform will perform the following actions:

  # google_compute_instance.test must be replaced
-/+ resource "google_compute_instance" "test" {
      + allow_stopping_for_update = true
      - enable_display            = false -> null
      - metadata                  = {} -> null
        name                      = "test"
      - resource_policies         = [] -> null

      + confidential_instance_config {
        }

      ~ network_interface {
        }

      - reservation_affinity { # forces replacement
          - type = "ANY_RESERVATION" -> null # forces replacement
        }

      ~ scheduling {

          + node_affinities {
            }
        }

      - shielded_instance_config {
          - enable_integrity_monitoring = true -> null
          - enable_secure_boot          = false -> null
          - enable_vtpm                 = true -> null
        }

      - timeouts {}
    }

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

References

@dex4er dex4er added the bug label Jun 28, 2021
@venkykuberan venkykuberan self-assigned this Jun 28, 2021
@venkykuberan
Copy link
Contributor

Agree, we need to set default value for the field. We will include it, thanks for filing the issue.

@github-actions
Copy link

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.