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

Google Cloud CPU Platform issues. #438

Closed
upodroid opened this issue Mar 27, 2019 · 4 comments
Closed

Google Cloud CPU Platform issues. #438

upodroid opened this issue Mar 27, 2019 · 4 comments

Comments

@upodroid
Copy link

upodroid commented Mar 27, 2019

Bug

Environment

  • Platform: google-cloud
  • OS: N/A
  • Release: latest?
  • Terraform and plugins
Terraform v0.11.13
+ provider.ct v0.3.1
+ provider.google v2.2.0
+ provider.local v1.2.0
+ provider.null v1.0.0
+ provider.template v1.0.0
+ provider.tls v1.2.0

Problem

Terraform complains about cpu platform not being available in a particlar region. Intel Haswell patform is not avalable in any of the newer regions such as europe-west2/6 . Haswell is available in europe-west1 which is OK but is there any reason why Container Linux can't run on newer platforms?

Terraform output

Error: Error applying plan:

3 error(s) occurred:

* module.google-cloud-yavin.google_compute_instance.controllers[2]: 1 error(s) occurred:

* google_compute_instance.controllers.2: Error creating instance: googleapi: Error 400: Invalid value for field 'resource.minCpuPlatform': 'Intel Haswell'. CPU platform unavailable in requested zone. Valid options for this zone are: Intel Skylake, Intel Broadwell., invalid
* module.google-cloud-yavin.google_compute_instance.controllers[1]: 1 error(s) occurred:

* google_compute_instance.controllers.1: Error creating instance: googleapi: Error 400: Invalid value for field 'resource.minCpuPlatform': 'Intel Haswell'. CPU platform unavailable in requested zone. Valid options for this zone are: Intel Skylake, Intel Broadwell., invalid
* module.google-cloud-yavin.google_compute_instance.controllers[0]: 1 error(s) occurred:

* google_compute_instance.controllers.0: Error creating instance: googleapi: Error 400: Invalid value for field 'resource.minCpuPlatform': 'Intel Haswell'. CPU platform unavailable in requested zone. Valid options for this zone are: Intel Skylake, Intel Broadwell., invalid

Terraform does not automatically rollback in the face of errors.
Instead, your Terraform state file has been partially updated with
any resources that successfully completed. Please address the error
above and apply again to incrementally change your infrastructure.
@dghubble
Copy link
Member

Typhoon GCP defines the minimum CPU platform as Haswell via #405. Meaning avoid Sandy/Ivy bridge, but allow Haswell or newer like Broadwell, Skylake, etc.

This sounds like a bug in terraform-provider-google and logic for comparing newer/older CPU platforms.

@dghubble
Copy link
Member

Ugh. No issue in terraform-provider-google or compute/v1 client. I think the backend Google Cloud API actually implements SetMinCpuPlatform to mean "use exactly that version or error". Rather misleading going by Terraform or API comments.

Compute Engine always uses the minimum CPU platform where available.

I found this mention here. No behavior is specified for what happens when its not available, but apparently it errors out.

Its also reproducible with gcloud.

gcloud compute instances create example-instance2 --zone europe-west2-b --min-cpu-platform "Intel Haswell"
ERROR: (gcloud.compute.instances.create) Could not fetch resource:
 - Invalid value for field 'resource.minCpuPlatform': 'Intel Haswell'. CPU platform unavailable in requested zone. Valid options for this zone are: Intel Skylake, Intel Broadwell.

Sadness. min_cpu_platform looks rather pointless now.

@dghubble
Copy link
Member

This would explain why setting min_cpu_platform did legitimately ensure Sandy/Ivy Bridge were skipped in other regions when this was verified, since Haswell was available.

dghubble added a commit that referenced this issue Mar 28, 2019
* Google Cloud API implements `min_cpu_platform` to mean
"use exactly this CPU"
* Fix error creating clusters in newer regions lacking Haswell
platform (e.g. europe-west2) (#438)
* Reverts #405, added in v1.13.4
* Original goal of ignoring old Ivy/Sandy bridge CPUs in older regions
will be achieved shortly anyway. Google Cloud is deprecating those CPUs
in April 2019
* https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform#how_selecting_a_minimum_cpu_platform_works
dghubble added a commit that referenced this issue Mar 28, 2019
* Google Cloud API implements `min_cpu_platform` to mean
"use exactly this CPU"
* Fix error creating clusters in newer regions lacking Haswell
platform (e.g. europe-west2) (#438)
* Reverts #405, added in v1.13.4
* Original goal of ignoring old Ivy/Sandy bridge CPUs in older regions
will be achieved shortly anyway. Google Cloud is deprecating those CPUs
in April 2019
* https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform#how_selecting_a_minimum_cpu_platform_works
@dghubble
Copy link
Member

dghubble commented Mar 28, 2019

Fixed by "46196af5009fb2abef89a979248cb4bd55c6b941", which you may use as the ref in your module source.

Snaipe pushed a commit to aristanetworks/monsoon that referenced this issue Apr 13, 2023
* Google Cloud API implements `min_cpu_platform` to mean
"use exactly this CPU"
* Fix error creating clusters in newer regions lacking Haswell
platform (e.g. europe-west2) (poseidon#438)
* Reverts poseidon#405, added in v1.13.4
* Original goal of ignoring old Ivy/Sandy bridge CPUs in older regions
will be achieved shortly anyway. Google Cloud is deprecating those CPUs
in April 2019
* https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform#how_selecting_a_minimum_cpu_platform_works
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants