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

data source alicloud_instance_types exports an invalid instance type #512

Closed
QuantumGhost opened this issue Jun 22, 2018 · 5 comments
Closed
Assignees

Comments

@QuantumGhost
Copy link

I have defined an instance type data source:

data "alicloud_instance_types" "ecs_4c8g" {
  cpu_core_count = 4
  memory_size = 8
  availability_zone = "cn-shenzhen-a"
  network_type = "Vpc"
}

and using it to creating new ECS instance: (irrelevant details removed)

resource "alicloud_instance" "server" {
  image_id = "ubuntu_16_0402_32_20G_alibase_20180409.vhd"
  instance_type = "${data.alicloud_instance_types.ecs_4c8g.instance_types.0.id}"
  instance_charge_type = "PrePaid"
  renewal_status = "AutoRenewal"
}

terraform plan works correctly and give the plan below: (irrelevant details removed)

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions: 

  + module.aliyun.alicloud_instance.server
      id:                         <computed>
      auto_renew_period:          "1"
      availability_zone:          <computed>
      dry_run:                    "false"
      image_id:                   "ubuntu_16_0402_32_20G_alibase_20180409.vhd"
      instance_charge_type:       "PrePaid"
      instance_type:              "ecs.s3.large"
      internet_max_bandwidth_out: "0"
      key_name:                   <computed>
      period:                     "1"
      period_unit:                "Month"
      private_ip:                 <computed>
      public_ip:                  <computed>
      renewal_status:             "AutoRenewal"
      role_name:                  <computed>
      status:                     <computed>
      subnet_id:                  <computed>
      system_disk_category:       "cloud_efficiency"
      system_disk_size:           "40"

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

------------------------------------------------------------------------

This plan was saved to: plans/create-ecs.plan

To perform exactly these actions, run the following command to apply:
    terraform apply "plans/create-ecs.plan"

Then terraform apply plans/create-ecs.plan gives error below: (irrelevant details removed)

module.aliyun.alicloud_instance.asset_prod: Creating...
  auto_renew_period:          "" => "1"
  availability_zone:          "" => "<computed>"
  image_id:                   "" => "ubuntu_16_0402_32_20G_alibase_20180409.vhd"
  include_data_disks:         "" => "true"
  instance_charge_type:       "" => "PrePaid"
  instance_type:              "" => "ecs.s3.large"
  internet_max_bandwidth_out: "" => "0"
  key_name:                   "" => "<computed>"
  period:                     "" => "1"
  period_unit:                "" => "Month"
  private_ip:                 "" => "<computed>"
  public_ip:                  "" => "<computed>"
  renewal_status:             "" => "AutoRenewal"
  role_name:                  "" => "<computed>"
  status:                     "" => "<computed>"
  subnet_id:                  "" => "<computed>"
  system_disk_category:       "" => "cloud_efficiency"
  system_disk_size:           "" => "40"

Error: Error applying plan:

1 error(s) occurred:

* module.aliyun.alicloud_instance.asset_prod: 1 error(s) occurred:

* alicloud_instance.asset_prod: The instance type ecs.s3.large is solded out or is not supported in the zone cn-shenzhen-a. Expected instance types: ecs.sn1ne.3xlarge, ecs.sn1ne.2xlarge, ecs.n4.xlarge, ecs.i1.6xlarge, ecs.mn4.2xlarge, ecs.se1.2xlarge, ecs.i1.3xlarge, ecs.mn4.large, ecs.i1.4xlarge, ecs.e4.small, ecs.i1.8xlarge, ecs.sn2ne.xlarge, ecs.mn4.xlarge, ecs.gn5i-c2g1.large, ecs.n4.small, ecs.gn5i-c16g1.4xlarge, ecs.mn4.8xlarge, ecs.i1.2xlarge, ecs.se1ne.2xlarge, ecs.n4.4xlarge, ecs.se1ne.8xlarge, ecs.n4.8xlarge, ecs.se1.8xlarge, ecs.mn4.small, ecs.se1ne.large, ecs.d1.4xlarge, ecs.se1ne.4xlarge, ecs.gn5i-c4g1.xlarge, ecs.sn2ne.2xlarge, ecs.se1ne.xlarge, ecs.se1.xlarge, ecs.gn5i-c8g1.2xlarge, ecs.n4.2xlarge, ecs.sn1ne.8xlarge, ecs.se1ne.6xlarge, ecs.sn1ne.6xlarge, ecs.se1.14xlarge, ecs.i1.xlarge, ecs.sn1ne.4xlarge, ecs.se1ne.3xlarge, ecs.xn4.small, ecs.d1.2xlarge, ecs.sn1ne.xlarge, ecs.se1.large, ecs.n4.large, ecs.sn1ne.large, ecs.sn2ne.large, ecs.se1.4xlarge, ecs.mn4.4xlarge

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.

According to the Docs,

NOTE: If one instance type is sold out, it will not be exported.

instance type ecs.s3.large should not be exported.

@QuantumGhost
Copy link
Author

According to Chinese documentation here, Aliyun has stopped selling instance with type ecs.s3.large.
I think the data source should not return instance type which is not selling.

@nightmeng nightmeng self-assigned this Nov 14, 2018
@xiaozhu36
Copy link
Collaborator

HI @QuantumGhost I am sorry for late reply. Can you show me the region used?

@QuantumGhost
Copy link
Author

QuantumGhost commented Jul 2, 2019

I do not remember it clearly. I guess it is cn-shenzhen since I have availability_zone = "cn-shenzhen-a" in my hcl file.

@xiaozhu36
Copy link
Collaborator

@QuantumGhost Thanks for your feedback. Just now, I have made a test and there is no ecs.s3.large exported in the cn-shenzhen-a.

@QuantumGhost
Copy link
Author

Maybe this issue is fixed at the server side?
Anyway, thanks for your help.

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

3 participants