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

r/vra_image_profile creation fails with more 4 image mappings #528

Open
1 task done
PaulAngus opened this issue Jun 19, 2024 · 0 comments
Open
1 task done

r/vra_image_profile creation fails with more 4 image mappings #528

PaulAngus opened this issue Jun 19, 2024 · 0 comments
Labels
bug Something isn't working needs-triage

Comments

@PaulAngus
Copy link

Code of Conduct

This project has a Code of Conduct that all participants are expected to understand and follow:

vRA Version

8.16.1

Terraform Version

1.6.6

vRA Terraform Provider Version

0.9.0

Affected Resource(s)

vra_image_profile

Terraform Configuration Files

Note: This is a truncated version of the code for demo purposes.

data "vra_region" "region_SW19-1" {
  filter = "name eq SW19-1-DC"
}

data "vra_region" "region_SW19-2" {
  filter = "name eq SW19-2-DC"
}

data "vra_cloud_account_vsphere" "SW19-1" {
  name = "VCS - SW19-1"
}

data "vra_cloud_account_vsphere" "SW19-2" {
  name = "VCS - SW19-2"
}

data "vra_image" "Micro-Linux-SW19-1" {
  filter = "name eq 'AlpineLinux-Template' and cloudAccountId eq '${data.vra_cloud_account_vsphere.SW19-1.id}'"
}

data "vra_image" "Micro-Linux-SW19-2" {
  filter = "name eq 'AlpineLinux-Template' and cloudAccountId eq '${data.vra_cloud_account_vsphere.SW19-2.id}'"
}

data "vra_image" "Ubuntu22-04-SW19-1" {
  filter = "name eq 'ubuntu-jammy-22.04-cloudimg' and cloudAccountId eq '${data.vra_cloud_account_vsphere.SW19-1.id}'"
}

data "vra_image" "Ubuntu22-04-SW19-2" {
  filter = "name eq 'ubuntu-jammy-22.04-cloudimg' and cloudAccountId eq '${data.vra_cloud_account_vsphere.SW19-2.id}'"
}

data "vra_image" "Oracle-8-SW19-1" {
  filter = "name eq 'Oracle8.9-Template' and cloudAccountId eq '${data.vra_cloud_account_vsphere.SW19-1.id}'"
}

data "vra_image" "Oracle-8-SW19-2" {
  filter = "name eq 'Oracle8.9-Template' and cloudAccountId eq '${data.vra_cloud_account_vsphere.SW19-2.id}'"
}

############ Resources ###########

resource "vra_image_profile" "mlin1" {
  name        = "test-image-profile"
  description = "test image profile"
  region_id   = data.vra_region.region_SW19-1.id

  image_mapping {
    name     = "Micro-Linux"
    image_id = data.vra_image.Micro-Linux-SW19-1.id
  }
}

resource "vra_image_profile" "mlin2" {
  name        = "test-image-profile"
  description = "test image profile"
  region_id   = data.vra_region.region_SW19-2.id

  image_mapping {
    name     = "Micro-Linux"
    image_id = data.vra_image.Micro-Linux-SW19-2.id
  }
}

resource "vra_image_profile" "mlin3" {
  name        = "test-image-profile"
  description = "test image profile"
  region_id   = data.vra_region.region_SW19-1.id

  image_mapping {
    name     = "Ubuntu22.04"
    image_id = data.vra_image.Ubuntu22-04-SW19-1.id
  }
}

resource "vra_image_profile" "mlin4" {
  name        = "test-image-profile"
  description = "test image profile"
  region_id   = data.vra_region.region_SW19-2.id

  image_mapping {
    name     = "Ubuntu22.04"
    image_id = data.vra_image.Ubuntu22-04-SW19-2.id
  }
}

resource "vra_image_profile" "mlin5" {
  name        = "test-image-profile"
  description = "test image profile"
  region_id   = data.vra_region.region_SW19-1.id

  image_mapping {
    name     = "Oracle-8"
    image_id = data.vra_image.Oracle-8-SW19-1.id
  }
}

resource "vra_image_profile" "mlin6" {
  name        = "test-image-profile"
  description = "test image profile"
  region_id   = data.vra_region.region_SW19-2.id

  image_mapping {
    name     = "Oracle-8"
    image_id = data.vra_image.Oracle-8-SW19-2.id
  }
}

Expected Behavior

All Image Mappings are created in Aria Automation Assembler.

Actual Behavior

When there are over roughly four Image Mappings (each with 2 images), errors start occuring and not all Mappings are created.

Steps to Reproduce

Using above code as an example, create (roughly) more than four Image Mappings (each with 2 images) and attempt to 'apply' the Terraform.

Screenshots

Debug Output

│ Error: response status code does not match any response statuses defined for this endpoint in the swagger spec (status 200): {}
│ 
│   with vra_image_profile.mlin5,
│   on AriaAutoImages.tf line 61, in resource "vra_image_profile" "mlin5":
│   61: resource "vra_image_profile" "mlin5" {
│ 
╵
╷
│ Error: response status code does not match any response statuses defined for this endpoint in the swagger spec (status 200): {}
│ 
│   with vra_image_profile.mlin6,
│   on AriaAutoImages.tf line 74, in resource "vra_image_profile" "mlin6":
│   74: resource "vra_image_profile" "mlin6" {

Panic Output

Important Factoids

When adding Mappings one by one in Terraform, the number of mappings at which errors start occuring is not consistent. Sometimes, if all state and provider data is removed and Terraform init is re-run. An 'apply' which previously failed will run successfully.

References

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
@PaulAngus PaulAngus added bug Something isn't working needs-triage labels Jun 19, 2024
@tenthirtyam tenthirtyam changed the title vra_image_profile Resource creation starts to fail when there are more than c. 4 Image Mappings r/vra_image_profile creation fails with more 4 image mappings Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage
Projects
None yet
Development

No branches or pull requests

1 participant