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

Unable to spin BMS with multiple PCI network interfaces #5341

Open
digvijay-ukirde opened this issue May 8, 2024 · 2 comments · May be fixed by #5364
Open

Unable to spin BMS with multiple PCI network interfaces #5341

digvijay-ukirde opened this issue May 8, 2024 · 2 comments · May be fixed by #5364
Labels
service/VPC Infrastructure Issues related to the VPC Infrastructure

Comments

@digvijay-ukirde
Copy link

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

Terraform CLI and Terraform IBM Provider Version

Affected Resource(s)

  • ibm_is_bare_metal_server

Terraform Configuration Files

Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.

resource "ibm_is_bare_metal_server" "itself" {
  profile = local.profile
  name    = local.name
  image   = local.image
  zone    = local.zone
  keys    = [local.key]
  vpc     = local.vpc  
  primary_network_interface {
    name            = "dv-pri"
    subnet          = local.subnet
    security_groups = [local.sg]
  }
  # Trying to create second PCI interface without vLAN
  dynamic "network_interfaces" {
    for_each = [1]
    content {
      name                      = "dv-sec"
      subnet                    = local.subnet
      enable_infrastructure_nat = true
      allow_ip_spoofing         = true
      security_groups           = [local.sg]
      interface_type = "pci"
    }  
  } 
}

Debug Output

│ Error: [DEBUG] Create bare metal server err Expected only one oneOf fields to be set: got 0

│     "Result": {
│         "errors": [
│             {
│                 "code": "validation_failed_oneof",
│                 "message": "Expected only one oneOf fields to be set: got 0",
│                 "target": {
│                     "name": "BareMetalServerPrototype",
│                     "type": "field"
│                 }
│             },
│             {
│                 "code": "validation_failed_required",
│                 "message": "BareMetalServerByNetworkAttachment is invalid: Validation Failure for field: primary_network_attachment",
│                 "target": {
│                     "name": "BareMetalServerByNetworkAttachment.primary_network_attachment",
│                     "type": "field"
│                 }
│             },
│             {
│                 "code": "validation_failed_minimum",
│                 "message": "BareMetalServerByNetworkInterface is invalid: Validation Failure for field: vlan",
│                 "target": {
│                     "name": "BareMetalServerByNetworkInterface.vlan",
│                     "type": "field",
│                     "value": "0"
│                 }
│             }
│         ],
│         "trace": "beae1560-2a59-40b0-aaba-022b00e1055a"
│     },
│     "RawResult": null
│ }

Panic Output

Expected Behavior

A BMS with 2 PCI interfaces (without vLAN) should get created

Actual Behavior

It fails looking for allowed_vlans variable.
If we provide a dummy vLAN -> allowed_vlans = [1], it works.
Need to make allowed_vlans optional in such scenarios.

Steps to Reproduce

  1. terraform apply

Important Factoids

References

  • #0000
@github-actions github-actions bot added the service/VPC Infrastructure Issues related to the VPC Infrastructure label May 8, 2024
@digvijay-ukirde
Copy link
Author

Response from BMS team member -
It looks like it is making an assumption on PCI if the allowed_vlans is set.
https://github.com/IBM-Cloud/terraform-provider-ibm/blob/master/ibm/service/vpc/resource_ibm_is_bare_metal_server.go#L1403
And it wrongly assumes there must be values in there (not an empty list) https://github.com/IBM-Cloud/terraform-provider-ibm/blob/master/ibm/service/vpc/resource_ibm_is_bare_metal_server.go#L1410

@ujjwal-ibm
Copy link
Collaborator

looking at it

@ujjwal-ibm ujjwal-ibm linked a pull request May 17, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service/VPC Infrastructure Issues related to the VPC Infrastructure
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants