Cannot set a fixed IP for Floating IP

624 views
Skip to first unread message

Chris Jefferies

unread,
Oct 4, 2017, 7:34:31 PM10/4/17
to Terraform

Here's how I'd like to define my floating ip:

# the jump host has a floating IP and association --------------------
resource
"openstack_networking_floatingip_v2" "floatip_1" {
  pool      
= "EXT_Corp"
  fixed_ip  
= "10.0.2.134"
  tenant_id
= "${var.tenantId}"
}

But it always complains when I add the fixed IP:

* openstack_networking_floatingip_v2.floatip_1: Error allocating floating IP: Invalid request due to incorrect syntax or missing required parameters.

If I comment out the fixed_ip line, it seems to work, but it allocates an IP from the IP range of the pool network.


Settings for EXT_Corp network:
IP version: IPv4
CIDR
10.0.2.0/24
IP allocation pool
Start 10.0.2.56  - End 10.0.2.58
Start 10.0.2.130 - End 10.0.2.146
Start 10.0.2.160 - End 10.0.2.169
Gateway IP - 10.0.2.1
DHCP
Enable Yes

What am I doing wrong?

Thanks,
Chris.

Rob Coward

unread,
Oct 4, 2017, 7:50:25 PM10/4/17
to terrafo...@googlegroups.com
Hi Chris,
I think that you mis-understand the point of a floating IP address. It will allocate an address on your ‘external’ network from the pool specified. The fixed_ip property is referring to the ‘internal’ IP address which associated to a port attached to an instance. According to the documentation at 
https://www.terraform.io/docs/providers/openstack/r/networking_floatingip_v2.html you should only need to specify the fixed_ip attribute if you are also specifying port_id, and that port has multiple addresses assigned to it.

Hope that helps.
Regards,
Rob


--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/terraform/issues
IRC: #terraform-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-too...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/2c6a621c-af70-4ea0-a8ce-1e6093377486%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Chris Jefferies

unread,
Oct 4, 2017, 8:27:48 PM10/4/17
to Terraform
Yes,
It clarifies how fixed_ip attribute is used in openstack_networking_floatingip_v2.

Is there a way to create a static IP that I could use from the pool?

Thank you,
Chris.

Joe Topjian

unread,
Oct 4, 2017, 8:44:40 PM10/4/17
to terrafo...@googlegroups.com
Hi Chris,

Do you mean you want to tell OpenStack which floating IP from the pool to use? If so, that's not possible with the OpenStack Terraform provider and I'm not sure if it's possible with the OpenStack tools directly. When you request a floating IP, you get a random floating IP from the external pool.

Thanks,
Joe

To unsubscribe from this group and stop receiving emails from it, send an email to terraform-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/402c4fc7-4e26-4937-a030-20f25e9197d6%40googlegroups.com.

Chris Jefferies

unread,
Oct 5, 2017, 4:00:02 AM10/5/17
to Terraform
OK.  I think you're right.  Yes, I wanted to have a consistent IP I could define.  Thanks for confirming.
Reply all
Reply to author
Forward
0 new messages