Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

ECS resizing issues. The capacity of flavor c6s.6xlarge.2 is not sufficient #64

@Bulat-Gumerov

Description

@Bulat-Gumerov

Hi there,

Terraform v1.1.7
on darwin_arm64
+ provider registry.terraform.io/g42cloud-terraform/g42cloud v1.3.0

Resizing of the instance is buggy, for example:

  required_providers {
    g42cloud = {
      source  = "g42cloud-terraform/g42cloud"
      version = "1.3.0"
    }
  }
}

data "g42cloud_availability_zones" "myaz" {}

data "g42cloud_vpc_subnet" "mynet" {
  name = "subnet-client-tier-private"
}

data "g42cloud_images_image" "myimage" {
  name        = "Ubuntu 18.04 server 64bit"
  most_recent = true
}

resource "g42cloud_compute_instance" "basic" {
  name              = "basic"
  image_id          = data.g42cloud_images_image.myimage.id
  flavor_id         = "c6s.large.2"
  security_groups   = ["default"]
  availability_zone = data.g42cloud_availability_zones.myaz.names[0]
  system_disk_type  = "SAS"
  system_disk_size  = 40
  network {
    uuid = data.g42cloud_vpc_subnet.mynet.id
  }
}

If we change the size of the ECS instance from c6s.large.2 to c6s.6xlarge.2, the resize operation fails:

  # g42cloud_compute_instance.basic will be updated in-place
  ~ resource "g42cloud_compute_instance" "basic" {
      ~ flavor_id             = "c6s.large.2" -> "c6s.6xlarge.2"
        id                    = "bd1f56bc-fb8c-440b-bcad-406178966ede"
        name                  = "basic"
        tags                  = {}
        # (16 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.
g42cloud_compute_instance.basic: Modifying... [id=bd1f56bc-fb8c-440b-bcad-406178966ede]
╷
│ Error: Error resizing g42cloud server: Bad request with: [POST https://ecs.ae-ad-1.g42cloud.com/v1.1/0f27bfadfb005b982f22c01a12bffc94/cloudservers/bd1f56bc-fb8c-440b-bcad-406178966ede/resize], error message: {"error":{"message":"The capacity of flavor c6s.6xlarge.2 is not sufficient.","code":"Ecs.0319"}}
│
│   with g42cloud_compute_instance.basic,
│   on main.tf line 28, in resource "g42cloud_compute_instance" "basic":28: resource "g42cloud_compute_instance" "basic" {
│
╵

List of available instance flavors: https://docs.g42cloud.com/en-us/usermanual/ecs/en-us_topic_0202842214.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions