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

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

Open
joelsdc opened this issue Sep 26, 2023 · 0 comments
Open

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

joelsdc opened this issue Sep 26, 2023 · 0 comments
Assignees

Comments

@joelsdc
Copy link

joelsdc commented Sep 26, 2023

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.

@pajuga pajuga self-assigned this Sep 27, 2023
pajuga added a commit that referenced this issue Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants