Skip to content

Extending a volume fails since 3.1.0 #1929

@jaydub

Description

@jaydub

Terraform Version

Terraform v1.12.2
on linux_amd64

  • provider registry.terraform.io/hashicorp/template v2.2.0
  • provider registry.terraform.io/terraform-provider-openstack/openstack v3.1.0

Affected Resource(s)

  • openstack_blockstorage_volume_v3

Terraform Configuration Files

The load bearing components are just an openstack_blockstorage_volume_v3 which exists and is attached to a running instance in an Openstack environment that supports online resizing of volumes. Increase the volume size, and watch the apply break.

resource "openstack_blockstorage_volume_v3" "live_extend_volume" {
  name        = "live_extend_volume"
  size        = var.volume_size
  volume_type = var.volume_type

  enable_online_resize = true
}

resource "openstack_compute_volume_attach_v2" "live_extend_volume_attach" {
  volume_id   = openstack_blockstorage_volume_v3.live_extend_volume.id
  instance_id = openstack_compute_instance_v2.generic_instance.id
}

Debug Output

Full gist

Expected Behavior

The volume increases in size when adjusted to a volume size higher than it currently is, as a resource change action. This is the case in versions of the provider prior to 3.1.0

Actual Behavior

Errors out at apply time with:

Expected HTTP response code [202] when accessing 
[POST https://api.nz-por-1.catalystcloud.io:8776/v2/622e988ee8f549ce837af8b38a7db125/volumes/9a0ca1b6-7d53-479e-961a-81ae4c3feb96/action], 
but got 400 instead: 
{"badRequest": 
    {"code": 400, "message": "Invalid volume: Volume 9a0ca1b6-7d53-479e-961a-81ae4c3feb96 status must be '{'status': 'available'}' to extend, currently in-use."}
}

(Line breaks added to improve readability.)

The .../v2/... component of the request is likely the smoking gun.

Steps to Reproduce

  1. Use an Openstack environment that supports online resizing of volumes
  2. Have some running instance with a volume attached to it already set up by terraform and in the state
  3. Increase the volume size of that attached volume
  4. Observe the plan indicating a change increasing the size on the volume
  5. terraform apply fails with the above error

Important Factoids

Catalyst Cloud runs an idiosyncratic combination of Openstack component versions that are not the latest ones, but online resize works using 3.0.0, so I don't expect that will be in play.

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