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

PowerVS Port Attachment Issue. #5470

Open
maulikcapg opened this issue Jun 25, 2024 · 2 comments
Open

PowerVS Port Attachment Issue. #5470

maulikcapg opened this issue Jun 25, 2024 · 2 comments
Labels
service/Power Systems Issues related to Power Systems

Comments

@maulikcapg
Copy link

maulikcapg commented Jun 25, 2024

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

IBM : 1.65.1

Affected Resource(s)

  • pi_network_port_attach

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_pi_network_port_attach" "port_attach_reserve" {
  count      = length(local.reserve_ips) > 0 ? length(local.reserve_ips) : 0

  pi_cloud_instance_id      = var.powervs_workspace_guid                          // workspace guid
  pi_instance_id            = local.reserve_ips[count.index].pvm_instance_id   // pvm_instance_id
  pi_network_name           = local.reserve_ips[count.index].name               // network name
  pi_network_port_ipaddress = local.reserve_ips[count.index].ip               // ip address from the network cidr
}

Debug Output

IBM Schemetic workspace logs:

 2024/06/24 20:10:31 Terraform apply | Error: failed to Get PI Network Port 06d6ce7f-7b6b-4a7b-8bde-48bac3924dae for Network reserve_network_1: [GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][404] pcloudNetworksPortsGetNotFound  &{Code:0 Description:network does not exist. Check the details and try again or contact support for help, id: 7cc54728-b892-4f2b-8812-cdc26dc4cfb9 Error:network not found Message:}
 2024/06/24 20:10:31 Terraform apply | 
 2024/06/24 20:10:31 Terraform apply |   with module.site1_powervs_instance.ibm_pi_network_port_attach.port_attach_reserve[0],
 2024/06/24 20:10:31 Terraform apply |   on ../../modules/powervs-instance-custom/main.tf line 305, in resource "ibm_pi_network_port_attach" "port_attach_reserve":
 2024/06/24 20:10:31 Terraform apply |  305: resource "ibm_pi_network_port_attach" "port_attach_reserve" {
 2024/06/24 20:10:31 Terraform apply | 
 2024/06/24 20:10:31 �[1m�[31mTerraform APPLY error: Terraform APPLY errorexit status 1�[39m�[0m

Panic Output

Expected Behavior

Network is already there so we should not get the error like network does not exist at the time of port attachment.

Actual Behavior

Network is already there and port also get attached but terraform is giving error like network does not exist at the time of port attachment .
This issue is intermittent, but we are getting this issue often.

IBM catalog schematic workspace logs:

 2024/06/24 20:10:31 Terraform apply | Error: failed to Get PI Network Port 06d6ce7f-7b6b-4a7b-8bde-48bac3924dae for Network reserve_network_1: [GET /pcloud/v1/cloud-instances/{cloud_instance_id}/networks/{network_id}/ports/{port_id}][404] pcloudNetworksPortsGetNotFound  &{Code:0 Description:network does not exist. Check the details and try again or contact support for help, id: 7cc54728-b892-4f2b-8812-cdc26dc4cfb9 Error:network not found Message:}
 2024/06/24 20:10:31 Terraform apply | 
 2024/06/24 20:10:31 Terraform apply |   with module.site1_powervs_instance.ibm_pi_network_port_attach.port_attach_reserve[0],
 2024/06/24 20:10:31 Terraform apply |   on ../../modules/powervs-instance-custom/main.tf line 305, in resource "ibm_pi_network_port_attach" "port_attach_reserve":
 2024/06/24 20:10:31 Terraform apply |  305: resource "ibm_pi_network_port_attach" "port_attach_reserve" {
 2024/06/24 20:10:31 Terraform apply | 
 2024/06/24 20:10:31 �[1m�[31mTerraform APPLY error: Terraform APPLY errorexit status 1�[39m�[0m

Here port is being attached but we are getting this error through the powervs port attachment resource.

Steps to Reproduce

  • Create powervs workspace using terraform-ibm-powervs-workspace.
  • Create network inside powervs workspace using ibm_pi_network resource.
  • Create powervs instance inside powervs workspace using terraform-ibm-powervs-instance .
  • Attach network port to the newly created powervs instance using ibm_pi_network_port_attach.
  • terraform apply

Important Factoids

References

  • #0000
@github-actions github-actions bot added the service/Power Systems Issues related to Power Systems label Jun 25, 2024
@yussufsh
Copy link
Collaborator

Can you verify if network is created in the same flow? If yes then you will need to reference network resource o/p to this resource or add explicit depends_on.

@ismirlia @michaelkad please help debugging this one.

@michaelkad
Copy link
Collaborator

@maulikcapg Have you tried what @yussufsh has suggested? Adding an explicit dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service/Power Systems Issues related to Power Systems
Projects
None yet
Development

No branches or pull requests

3 participants