Skip to content

Cannot add Storage Network IP to server via 'pnap_server' resource #32

@joelsdc

Description

@joelsdc

Description

I'm using latest version 0.22.0 of the provider with Terraform v1.3.9 and I'm unable to add a Storage Network IP to an existing server (what in PNAP is known as "Assign a server to a network").

Steps-to-reproduce

I have a set of servers created like:

resource "pnap_server" "agent_1" {
  hostname    = "agent-1"
  description = "Agent 1"
  os          = "windows/srv2019std"
  type        = "s2.c2.small"
  location    = pnap_private_network.test_phx.location

  install_default_ssh_keys = true

  pricing_model                 = "ONE_MONTH_RESERVATION"
  rdp_allowed_ips               = [var.test_ip]
  management_access_allowed_ips = [var.test_ip]

  network_type = "PRIVATE_ONLY"

  network_configuration {
    gateway_address = tolist(pnap_server.test_phx_gateway.private_ip_addresses)[0]
    private_network_configuration {
      configuration_type = "USER_DEFINED"
      private_networks {
        server_private_network {
          id  = pnap_private_network.test_phx.id
          ips = ["A.B.C.12"]
        }
      }
    }
  }
}

I created a storage network, so I updated the resource to:

resource "pnap_server" "agent_1" {
  hostname    = "agent-1"
  description = "Agent 1"
  os          = "windows/srv2019std"
  type        = "s2.c2.small"
  location    = pnap_private_network.test_phx.location

  install_default_ssh_keys = true

  pricing_model                 = "ONE_MONTH_RESERVATION"
  rdp_allowed_ips               = [var.test_ip]
  management_access_allowed_ips = [var.test_ip]

  network_type = "PRIVATE_ONLY"

  network_configuration {
    gateway_address = tolist(pnap_server.test_phx_gateway.private_ip_addresses)[0]
    private_network_configuration {
      configuration_type = "USER_DEFINED"
      private_networks {
        server_private_network {
          id  = pnap_private_network.test_phx.id
          ips = ["A.B.C.12"]
        }
      }
      private_networks {
        server_private_network {
          id  = pnap_storage_network.test_phx_storage.network_id
          ips = ["D.E.F.12"]
        }
      }
    }
  }
}

When I run terraform plan I see the change:

  # pnap_server.agent_1 will be updated in-place
  ~ resource "pnap_server" "agent_1" {
        id                            = "XXX"
        # (24 unchanged attributes hidden)

      ~ network_configuration {
            # (1 unchanged attribute hidden)

          ~ private_network_configuration {
                # (2 unchanged attributes hidden)

              + private_networks {
                  + server_private_network {
                      + id  = "XXX"
                      + ips = [
                          + "D.E.F.12",
                        ]
                    }
                }

                # (1 unchanged block hidden)
            }
        }
    }

But we get an error on apply:

pnap_server.agent_1: Modifying... [id=XXX]
╷
│ Error: unsupported action
│
│   with pnap_server.agent_1,
│   on pnap_servers.tf line 159, in resource "pnap_server" "agent_1":
│  159: resource "pnap_server" "agent_1" {

After the error, the next plan doesn't detect that the change is pending but in the UI we cannot see the assignment and via API we don't see the IP being allocated (although in the state file it was saved as done):

No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration and found no differences, so no changes are needed.

Apply complete! Resources: 0 added, 0 changed, 0 destroyed.

Let me know what I can do to help troubleshoot this issue.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions