-
Notifications
You must be signed in to change notification settings - Fork 383
Extending a volume fails since 3.1.0 #1929
Description
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
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
- Use an Openstack environment that supports online resizing of volumes
- Have some running instance with a volume attached to it already set up by terraform and in the state
- Increase the volume size of that attached volume
- Observe the plan indicating a change increasing the size on the volume
terraform applyfails 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.