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

Server type inconsistent: "VC1S" => "X64-2GB" #17

Closed
harobed opened this issue Sep 7, 2017 · 3 comments · Fixed by #23
Closed

Server type inconsistent: "VC1S" => "X64-2GB" #17

harobed opened this issue Sep 7, 2017 · 3 comments · Fixed by #23
Labels
enhancement instance Instance issues, bugs and feature requests

Comments

@harobed
Copy link

harobed commented Sep 7, 2017

When I look the --commercial-type list, I see:

$ scw create --help
...
  --commercial-type=X64-2GB Create a server with specific commercial-type C1, C2[S|M|L], X64-[2|4|8|15|30|60|120]GB, ARM64-[2|4|8]GB

I use X64-2GB server type in my terraform config file:

resource "scaleway_server" "myserver" {
  name = "myserver"
  image = "a869957c-6e1a-4b99-bc07-0748aa42c616"
  type = "VC1S"
}

After terraform apply execution, if I launch terraform plan I have:

Terraform will perform the following actions:

-/+ scaleway_server.monitor1 (new resource required)
      id:           "321ab554-7c16-447d-ac3a-db06f82aa04f" => <computed>
      enable_ipv6:  "false" => "false"
      image:        "a869957c-6e1a-4b99-bc07-0748aa42c616" => "a869957c-6e1a-4b99-bc07-0748aa42c616"
      name:         "myserver" => "myserver"
      ...
      state_detail: "booted" => <computed>
      type:         "VC1S" => "X64-2GB"

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

terraform read VC1S and not X64-2GB then it want always destroy the server.

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

@nicolai86 nicolai86 added the bug label Sep 8, 2017
@nicolai86
Copy link
Contributor

nicolai86 commented Sep 8, 2017

@harobed thank you for the report.

Smaller X64 instance types are called VCxy. The smallest X64 instance type is X64-15GB. Misleadingly, the Scaleway API accepts X64-2GB and creates a VC1S instead. This is where your bug report comes in.
I agree that the Scaleway provider should validate the instance type.

See this for a working X64-15GB instance type:

provider "scaleway" {}

data "scaleway_image" "ubuntu" {
  architecture = "x86_64"
  name         = "Ubuntu Zesty"
}

resource "scaleway_server" "base" {
  name  = "test"
  image = "${data.scaleway_image.ubuntu.id}"
  type  = "X64-15GB"

  volume {
    size_in_gb = 150
    type       = "l_ssd"
  }
}

I will keep this bug report open as a reminder to implement commercial type validation as part of the provider.

@nicolai86
Copy link
Contributor

I've just checked the Scaleway API, the best way to date would be to consume server availability via https://availability.scaleway.com/availability.json and extract the valid server types from that API call. This way we're on the safe side when Scaleway decides to add new server types.

I still need to investigate how to best do this in an attribute validation callback inside terraform.

@nicolai86
Copy link
Contributor

The SDK has been updated - I hope to be able to extend the SDK over thanksgiving to validate server types. I'll let you know how it goes :)

nicolai86 added a commit that referenced this issue Oct 8, 2017
fetch the list of known server types on initialization and cache it to
use it to validate r/server against it later.

closes #17
@remyleone remyleone added the instance Instance issues, bugs and feature requests label Jul 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement instance Instance issues, bugs and feature requests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants