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

Wrong client microversion (X-Openstack-Nova-Api-Version) for volume type with multiattach option enabled #1057

Closed
pawcykca opened this issue Sep 9, 2020 · 1 comment

Comments

@pawcykca
Copy link
Contributor

pawcykca commented Sep 9, 2020

Terraform Version

Terraform v0.13.2
+ provider registry.terraform.io/terraform-providers/openstack v1.31.0

Affected Resource(s)

  • openstack_compute_instance_v2

Terraform Configuration Files

resource "openstack_blockstorage_volume_v3" "bastion01_vol01" {
  name = "bastion01_vol1"
  size = "20"
  image_id = var.open_stack_image_id
  enable_online_resize = true
  volume_type = "gp-ceph-nolimit"
  availability_zone = "az1-sse6"
}

resource "openstack_compute_instance_v2" "bastion01" {
  name            = "bastion01"
  flavor_id       = var.open_stack_flavor_id
  key_pair        = "czk-devops"
  security_groups = ["allow_all_out","allow_ssh_in_from_ca","allow_icmp"]
  availability_zone = "az1-sse6"

  block_device {
    uuid                  = openstack_blockstorage_volume_v3.bastion01_vol01.id
    source_type           = "volume"
    boot_index            = 0
    destination_type      = "volume"
    delete_on_termination = false
  }

  network {
    name = "cloud_testnet"
  }
}

Debug Output

https://gist.github.com/pawcykca/65bfcf964a6e2b19125ce7e0f91c6e7f

Expected Behavior

What should have happened?

The Terraform Openstack Provider should have realized that the volume type of volume defined in block_device section has multiattach option enabled and choose correct microversion for compute endpoint (set X-Openstack-Nova-Api-Version header).

or

There should be a ability do define microversion for selected service endpoints.

Actual Behavior

What actually happened?

The Terraform Openstack Provider sends the default microsversion for the compute endpoint (does not set the X-Openstack-Nova-Api-Version header) and the operation fails.

openstack_compute_instance_v2.bastion01: Creating...

Error: Error creating OpenStack server: Bad request with: [POST https://my-cloud:13774/v2.1/servers], error message: {"badRequest": {"code": 400, "message": "Multiattach volumes are only supported starting with compute API version 2.60."}}

  on instances.tf line 13, in resource "openstack_compute_instance_v2" "bastion01":
  13: resource "openstack_compute_instance_v2" "bastion01" {

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. Create volume type with multiattach option enabled
$ cinder type-create gp-ceph-nolimit
$ cinder type-key gp-ceph-nolimit set multiattach="<is> True"
  1. Create volume and instance based on this volume type (as in 'Terraform Configuration Files' section above)
ralgar added a commit to ralgar/terraform-provider-openstack that referenced this issue Apr 9, 2023
Always pin Compute microversion to 2.67 when using block_device. This
solves terraform-provider-openstack#1057 while adhering to KISS priciple.
ralgar added a commit to ralgar/terraform-provider-openstack that referenced this issue Apr 9, 2023
Always pin Compute microversion to 2.67 when using block_device. This
solves terraform-provider-openstack#1057 while adhering to KISS priciple.
ralgar added a commit to ralgar/terraform-provider-openstack that referenced this issue Apr 9, 2023
Always pin Compute microversion to 2.67 when using block_device. This
solves terraform-provider-openstack#1057 while adhering to KISS priciple.
ralgar added a commit to ralgar/terraform-provider-openstack that referenced this issue Apr 9, 2023
Always pin Compute microversion to 2.67 when using block_device. This
solves terraform-provider-openstack#1057 while adhering to KISS priciple.
ralgar added a commit to ralgar/terraform-provider-openstack that referenced this issue Apr 9, 2023
Always pin Compute microversion to 2.67 when using block_device. This
solves terraform-provider-openstack#1057 while adhering to KISS priciple.
@nikParasyr
Copy link
Member

Closing this. Resolved by #1542

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants