Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

reserved_ip for private IPv4 #128

Closed
johnstudarus opened this issue Mar 23, 2019 · 4 comments
Closed

reserved_ip for private IPv4 #128

johnstudarus opened this issue Mar 23, 2019 · 4 comments

Comments

@johnstudarus
Copy link
Contributor

johnstudarus commented Mar 23, 2019

Any reason why there isn't support for private address allocations? Seems like it would be an easy feature to add (underlying API supports it).

resource "packet_reserved_ip_block" "my_private_elastic_ip" {
  project_id = "${var.packet_project_id}"
  facility   = "ewr1"
  type       = "private_ipv4"                        # new feature <---------------
  quantity   = 1
}
@t0mk
Copy link
Contributor

t0mk commented Mar 25, 2019

Hi @johnstudarus I don't think Packet API supports private ipv4 block reservation, I've just tried:

2019/03/25 16:39:16 
=======[REQUEST]=============
POST /projects/64dc1cf4-a560-4511-b499-3ebab34ceefb/ips HTTP/1.1
{"type":"private_ipv4","quantity":2,"comments":"packngo test","facility":"ewr1"}

2019/03/25 16:39:16 
=======[RESPONSE]============
HTTP/2.0 422 Unprocessable Entity
{"errors":["Type must be public_ipv4 or global_ipv4"]}

.. however there are pre-allocated private IP blocks per faciltiy, and they can be used (to some extent) with https://www.terraform.io/docs/providers/packet/d/precreated_ip_block.html

@johnstudarus
Copy link
Contributor Author

Interesting...

Through the GUI, you can request a private_ipv4 block by clicking on the server first and then drilling down. But if you click through from the project network, you can't get request a private_ipv4 block...

@t0mk
Copy link
Contributor

t0mk commented Mar 25, 2019

IIUC, from the device -> Network section in the UI, you don't request blocks, you just assign private IP from pre-allocated private IPv4 block in the facility. The private IPv4 block is allocated in the facilility when you run a device in the faciltiy.

Theoretically, it should be possible to assign IP from a block with the precreated_ip_block datasource. It might not be srtaightforward though, because the block will not exists before the (first) device is created in a faciltiy.

@displague
Copy link
Member

The ability to assign private IPs dynamically, after the initial provision, could be possible with equinix/terraform-provider-metal#12 (comment). I'm not sure if it would be possible to change those addresses after the port has been toggled to Layer3 for the first time (perhaps the provider would need to convert to layer2 and back to layer3 to add additional addresses?). I believe there is a limit of 1 private IP range per device.

In any case, I'm closing this issue as this provider is being deprecated in favor of the Equinix Metal provider
https://github.com/equinix/terraform-provider-metal

Let's bring this issue up again over there if there is still interest.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants