baidubce / terraform-provider-baiducloud

Terraform provider for BaiduCloud
https://www.terraform.io/docs/providers/baiducloud/
Mozilla Public License 2.0
23 stars 19 forks source link

Volume.DiskQuotaExceededLimit; Message: Number of volumes exceeds limit #8

Open novboy opened 3 years ago

novboy commented 3 years ago

when i create a new baiducloud_instance and attach a new disk, the disk create falied with a message:

│ Error: [ERROR] terraform-provider-baiducloud/baiducloud/resource_baiducloud_cds.go:191: Resource baiducloud_cds Create CDS volume Failed!!! [SDK bce-sdk-go ERROR]: │ [Code: Volume.DiskQuotaExceededLimit; Message: Number of volumes exceeds limit.; RequestId: f31b9bb5-b2f4-4b53-80c4-8fe2d2446854]

Terraform will perform the following actions:

  # baiducloud_cds.tf-server-data will be created
  + resource "baiducloud_cds" "tf-server-data" {
      + auto_snapshot_policy_id = (known after apply)
      + create_time             = (known after apply)
      + description             = "terraform create cds"
      + disk_size_in_gb         = 40
      + expire_time             = (known after apply)
      + id                      = (known after apply)
      + name                    = "tf-server-data"
      + payment_timing          = "Postpaid"
      + snapshot_id             = (known after apply)
      + status                  = (known after apply)
      + storage_type            = "hdd"
      + type                    = (known after apply)
      + zone_name               = "cn-bj-b"
    }

  # baiducloud_cds_attachment.default will be created
  + resource "baiducloud_cds_attachment" "default" {
      + attachment_device = (known after apply)
      + attachment_serial = (known after apply)
      + cds_id            = (known after apply)
      + id                = (known after apply)
      + instance_id       = (known after apply)
    }

  # baiducloud_eip.tf-eip will be created
  + resource "baiducloud_eip" "tf-eip" {
      + bandwidth_in_mbps = 100
      + billing_method    = "ByTraffic"
      + create_time       = (known after apply)
      + eip               = (known after apply)
      + eip_instance_type = (known after apply)
      + expire_time       = (known after apply)
      + id                = (known after apply)
      + name              = "tf-eip"
      + payment_timing    = "Postpaid"
      + share_group_id    = (known after apply)
      + status            = (known after apply)
    }

  # baiducloud_eip_association.tf-eip-link will be created
  + resource "baiducloud_eip_association" "tf-eip-link" {
      + eip           = (known after apply)
      + id            = (known after apply)
      + instance_id   = (known after apply)
      + instance_type = "BCC"
    }

  # baiducloud_instance.tf-server will be created
  + resource "baiducloud_instance" "tf-server" {
      + action                   = "start"
      + auto_renew               = (known after apply)
      + auto_renew_time_length   = 1
      + availability_zone        = "cn-bj-b"
      + billing                  = {
          + "payment_timing" = "Postpaid"
        }
      + cds_auto_renew           = false
      + cpu_count                = 1
      + create_time              = (known after apply)
      + delete_cds_snapshot_flag = false
      + expire_time              = (known after apply)
      + id                       = (known after apply)
      + image_id                 = "m-hDf0Uqut"
      + instance_type            = "N2"
      + internal_ip              = (known after apply)
      + keypair_id               = "k-mNMZVoe5"
      + keypair_name             = (known after apply)
      + memory_capacity_in_gb    = 1
      + name                     = "tf-instance"
      + network_capacity_in_mbps = (known after apply)
      + placement_policy         = (known after apply)
      + public_ip                = (known after apply)
      + related_release_flag     = false
      + root_disk_size_in_gb     = 40
      + root_disk_storage_type   = "cloud_hp1"
      + security_groups          = [
          + "g-34pxziaa8vi9",
        ]
      + status                   = (known after apply)
      + subnet_id                = "sbn-uj89sdh9d4fp"
      + vpc_id                   = (known after apply)
    }

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

Do you want to perform these actions in workspace "vm-2"?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

baiducloud_eip.tf-eip: Creating...
baiducloud_instance.tf-server: Creating...
baiducloud_cds.tf-server-data: Creating...
baiducloud_eip.tf-eip: Still creating... [10s elapsed]
baiducloud_instance.tf-server: Still creating... [10s elapsed]
baiducloud_eip.tf-eip: Creation complete after 12s [id=180.76.154.104]
baiducloud_instance.tf-server: Still creating... [20s elapsed]
baiducloud_instance.tf-server: Still creating... [30s elapsed]
baiducloud_instance.tf-server: Still creating... [40s elapsed]
baiducloud_instance.tf-server: Still creating... [50s elapsed]
baiducloud_instance.tf-server: Still creating... [1m0s elapsed]
baiducloud_instance.tf-server: Still creating... [1m10s elapsed]
baiducloud_instance.tf-server: Still creating... [1m20s elapsed]
baiducloud_instance.tf-server: Still creating... [1m30s elapsed]
baiducloud_instance.tf-server: Still creating... [1m40s elapsed]
baiducloud_instance.tf-server: Still creating... [1m50s elapsed]
baiducloud_instance.tf-server: Still creating... [2m0s elapsed]
baiducloud_instance.tf-server: Still creating... [2m10s elapsed]
baiducloud_instance.tf-server: Still creating... [2m20s elapsed]
baiducloud_instance.tf-server: Still creating... [2m30s elapsed]
baiducloud_instance.tf-server: Still creating... [2m40s elapsed]
baiducloud_instance.tf-server: Still creating... [2m50s elapsed]
baiducloud_instance.tf-server: Creation complete after 3m0s [id=i-nJMIKbZW]
baiducloud_eip_association.tf-eip-link: Creating...
baiducloud_eip_association.tf-eip-link: Still creating... [10s elapsed]
baiducloud_eip_association.tf-eip-link: Creation complete after 13s [id=180.76.154.104]
╷
│ Error: [ERROR] terraform-provider-baiducloud/baiducloud/resource_baiducloud_cds.go:191: Resource baiducloud_cds Create CDS volume Failed!!! [SDK bce-sdk-go ERROR]:
│ [Code: Volume.DiskQuotaExceededLimit; Message: Number of volumes exceeds limit.; RequestId: f31b9bb5-b2f4-4b53-80c4-8fe2d2446854]
│ 
│   on baidu-vm.tf line 32, in resource "baiducloud_cds" "tf-server-data":
│   32: resource "baiducloud_cds" "tf-server-data" {
│ 

The disk created successfuly after retry again:

baiducloud_eip.tf-eip: Refreshing state... [id=180.76.154.104]
baiducloud_instance.tf-server: Refreshing state... [id=i-nJMIKbZW]
baiducloud_eip_association.tf-eip-link: Refreshing state... [id=180.76.154.104]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # baiducloud_cds.tf-server-data will be created
  + resource "baiducloud_cds" "tf-server-data" {
      + auto_snapshot_policy_id = (known after apply)
      + create_time             = (known after apply)
      + description             = "terraform create cds"
      + disk_size_in_gb         = 40
      + expire_time             = (known after apply)
      + id                      = (known after apply)
      + name                    = "tf-server-data"
      + payment_timing          = "Postpaid"
      + snapshot_id             = (known after apply)
      + status                  = (known after apply)
      + storage_type            = "hdd"
      + type                    = (known after apply)
      + zone_name               = "cn-bj-b"
    }

  # baiducloud_cds_attachment.default will be created
  + resource "baiducloud_cds_attachment" "default" {
      + attachment_device = (known after apply)
      + attachment_serial = (known after apply)
      + cds_id            = (known after apply)
      + id                = (known after apply)
      + instance_id       = "i-nJMIKbZW"
    }

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

Do you want to perform these actions in workspace "vm-2"?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

baiducloud_cds.tf-server-data: Creating...
baiducloud_cds.tf-server-data: Still creating... [10s elapsed]
baiducloud_cds.tf-server-data: Still creating... [20s elapsed]
baiducloud_cds.tf-server-data: Still creating... [30s elapsed]
baiducloud_cds.tf-server-data: Still creating... [40s elapsed]
baiducloud_cds.tf-server-data: Creation complete after 40s [id=v-LTPPeii1]
baiducloud_cds_attachment.default: Creating...
baiducloud_cds_attachment.default: Still creating... [10s elapsed]
baiducloud_cds_attachment.default: Creation complete after 11s [id=v-LTPPeii1]

Apply complete! Resources: 2 added, 0 changed, 0 destroyed.
zhihuwang commented 3 years ago

the workaround, create cds with bcc ,then import cds with cds_id