hashicorp / terraform

Terraform enables you to safely and predictably create, change, and improve infrastructure. It is a source-available tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.
https://www.terraform.io
Other
42.76k stars 9.56k forks source link

Feature Request: Openstack LBaasV2 Port ID required for FloatingIP #9919

Closed ollypom closed 8 years ago

ollypom commented 8 years ago

Hey,

I'm running a HPE Helion Cloud (Running Mitaka). When trying to create a floating IP for my loadbalancerv2, it will not create as it requires a port-id.

{"NeutronError": {"message": "Bad floatingip request: fixed_ip_address cannot be specified without a port_id.", "type": "BadRequest", "detail": ""}}

My file contains:

resource "openstack_networking_floatingip_v2" "floatingip2" {
  pool       = "${var.pool}"
  depends_on = ["openstack_networking_router_interface_v2.routerinterface1"]
  fixed_ip   = "${openstack_lb_loadbalancer_v2.lb1.vip_address}"
}

However I can't specify a port ID as it is not a field in the Loadbalancerv2 Resource (Unless i'm mistaken).


openstack_lb_loadbalancer_v2.lb1:
  id = 
  admin_state_up = 
  description = 
  flavor = 
  name = 
  provider = 
  region = 
  tenant_id = 
  vip_address = 
  vip_subnet_id = 

Does anyone have any suggestions without hardcoding a value? Thanks a lot for your help :)

Olly

jtopjian commented 8 years ago

@ollypom Thanks for the report. Do you have the neutron commands on-hand that would accomplish this? If so, can you provide the input and output including debug (neutron --debug ...). That would help pinpoint where the attribute should go.

ollypom commented 8 years ago

@jtopjian Awesome thanks.

It can be found either with neutron port-list or neutron lbaas-loadbalancer-show. Using the later the trail would be.

neutron --debug lbaas-loadbalancer-show 3f6cd5fa-a435-432c-9c37-761645b5dd0b | grep vip_port_id

DEBUG: neutronclient.neutron.v2_0.lb.v2.loadbalancer.ShowLoadBalancer run(Namespace(columns=[], fields=[], formatter='table', id='3f6cd5fa-a435-432c-9c37-761645b5dd0b', max_width=0, noindent=False, prefix='', request_format='json', show_details=False, variables=[]))

DEBUG: keystoneauth.session REQ: curl -g -i -X GET https://hos.test.com:5000/v2.0 -H "Accept: application/json" -H "User-Agent: neutron keystoneauth1/2.15.0 python-requests/2.11.1 CPython/3.5.2"

DEBUG: keystoneauth.session RESP: [200] Date: Mon, 07 Nov 2016 17:13:40 GMT Server: Apache/2.4.10 (Debian) Vary: X-Auth-Token x-openstack-request-id: req-77a20fc9-b825-4866-afea-d840e8d5f9c6 Content-Length: 340 Content-Type: application/json 

RESP BODY: {"version": {"status": "stable", "updated": "2014-04-17T00:00:00Z", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.identity-v2.0+json"}], "id": "v2.0", "links": [{"href": "https://hos.test.com:5000/v2.0/", "rel": "self"}, {"href": "http://docs.openstack.org/", "type": "text/html", "rel": "describedby"}]}}

DEBUG: keystoneauth.identity.v2 Making authentication request to https://hos.test.com:5000/v2.0/tokens

DEBUG: keystoneauth.session REQ: curl -g -i -X GET https://hos.test.com:9696/v2.0/lbaas/loadbalancers.json?id=3f6cd5fa-a435-432c-9c37-761645b5dd0b&fields=id -H "Accept: application/json" -H "User-Agent: python-neutronclient" -H "X-Auth-Token: {SHA1}b992783af55ffbd35755c41c59db5ecb33ba73a8"

DEBUG: keystoneauth.session RESP: [200] Content-Type: application/json; charset=UTF-8 Content-Length: 388 X-Openstack-Request-Id: req-d6b2e50e-5395-45f7-84d3-4cee3515d26c Date: Mon, 07 Nov 2016 17:13:42 GMT Connection: keep-alive 

RESP BODY: {"loadbalancers": [{"description": "", "provisioning_status": "ACTIVE", "admin_state_up": true, "provider": "octavia", "pools": [], "listeners": [], "vip_port_id": "a7826732-53f5-4b82-bd52-32839a31c21c", "vip_address": "192.168.200.4", "vip_subnet_id": "864e218b-9c09-41fe-b20b-37313f8898a9", "id": "3f6cd5fa-a435-432c-9c37-761645b5dd0b", "operating_status": "ONLINE", "name": "testlb"}]}

DEBUG: neutronclient.v2_0.client GET call to neutron for https://hos.test.com:9696/v2.0/lbaas/loadbalancers.json?id=3f6cd5fa-a435-432c-9c37-761645b5dd0b&fields=id used request id req-d6b2e50e-5395-45f7-84d3-4cee3515d26c

DEBUG: keystoneauth.session REQ: curl -g -i -X GET https://hos.test.com:9696/v2.0/lbaas/loadbalancers/3f6cd5fa-a435-432c-9c37-761645b5dd0b.json -H "Accept: application/json" -H "User-Agent: python-neutronclient" -H "X-Auth-Token: {SHA1}b992783af55ffbd35755c41c59db5ecb33ba73a8"

DEBUG: keystoneauth.session RESP: [200] Content-Type: application/json; charset=UTF-8 Content-Length: 434 X-Openstack-Request-Id: req-c6851782-76f7-4b80-a3c0-fde0993e3025 Date: Mon, 07 Nov 2016 17:13:43 GMT Connection: keep-alive 

RESP BODY: {"loadbalancer": {"description": "", "admin_state_up": true, "tenant_id": "0e175ccb90d1450fa8423bcae1e020a0", "provisioning_status": "ACTIVE", "vip_subnet_id": "864e218b-9c09-41fe-b20b-37313f8898a9", "listeners": [], "vip_address": "192.168.200.4", "vip_port_id": "a7826732-53f5-4b82-bd52-32839a31c21c", "provider": "octavia", "pools": [], "id": "3f6cd5fa-a435-432c-9c37-761645b5dd0b", "operating_status": "ONLINE", "name": "testlb"}}

DEBUG: neutronclient.v2_0.client GET call to neutron for https://hos.test.com:9696/v2.0/lbaas/loadbalancers/3f6cd5fa-a435-432c-9c37-761645b5dd0b.json used request id req-c6851782-76f7-4b80-a3c0-fde0993e3025

| vip_port_id         | a7826732-53f5-4b82-bd52-32839a31c21c |

Thanks a lot.

jtopjian commented 8 years ago

@ollypom Ah, support for vip_port_id was just merged in and is available as of the latest Terraform release: https://github.com/hashicorp/terraform/commit/b269b417b0374f608ad2aa4f3422cc48b1d95208

Does this help? Or is something still missing?

ollypom commented 8 years ago

@jtopjian Ah awesome! Foolishly didn't check the latest release notes. Thanks a lot :)

ghost commented 4 years ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.