VMware: vim.get_soap_url improper IPv6 address

Bug #1287292 reported by Eric Brown
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Eric Brown
oslo-incubator
Fix Released
Undecided
Unassigned

Bug Description

The vim.get_soap_url function incorrectly builds an IPv6 address using hostname/IP and port.

https://github.com/openstack/nova/blob/master/nova/virt/vmwareapi/vim.py#L151

The result of this line would create an address as follows:
https://[2001:db8:85a3:8d3:1319:8a2e:370:7348:443]/sdk

Ports should be outside the square brackets, not inside, as follows:

https://[2001:db8:85a3:8d3:1319:8a2e:370:7348]:443/sdk

For reference see: http://en.wikipedia.org/wiki/IPv6_address section Literal IPv6 addresses in network resource identifiers

Tags: vmware
Tracy Jones (tjones-i)
Changed in nova:
importance: Undecided → Low
Revision history for this message
Eric Brown (ericwb) wrote :

Python 3.3 adds a nice convenience class to handle IP addresses.
http://docs.python.org/3.3/library/ipaddress

Eric Brown (ericwb)
description: updated
Eric Brown (ericwb)
Changed in nova:
assignee: nobody → Eric Brown (ericwb)
status: New → In Progress
Revision history for this message
Eric Brown (ericwb) wrote :

After further research, a port should not be specified as part of host_name. First of all, in the case of IPv6, you can't tell if there is a port specified because IPv6 addresses use ':' as part of the address. Secondly, the host_name is comes from the nova.conf vmware.host_ip which does not indicate a port can be specified. So I'll update the comments in vim.py.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.openstack.org/78455

Eric Brown (ericwb)
Changed in nova:
status: In Progress → Fix Committed
Changed in nova:
milestone: none → icehouse-rc1
Tracy Jones (tjones-i)
Changed in nova:
milestone: icehouse-rc1 → next
Revision history for this message
Andrew Laski (alaski) wrote :

The fix is still under review.

Changed in nova:
status: Fix Committed → In Progress
Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote :

We need to fix oslo.vmware as well.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/78455
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=4640542cc502a442d4807822d75d3fa3eff0a33b
Submitter: Jenkins
Branch: master

commit 4640542cc502a442d4807822d75d3fa3eff0a33b
Author: Eric Brown <email address hidden>
Date: Wed Mar 5 18:37:00 2014 -0500

    VMware: Fix usage of an alternate ESX/vCenter port

    IPv6 addresses use square brackets to delimit address vs. port.
    A comment in vim.py file incorrectly states the host and port can be
    specified as host:port. According to nova.conf, port isn't
    even part of the host option.

    This patch will create a separate port option to nova.conf instead
    of allowing the port to be part of the host_ip option.

    DocImpact: new host_port option added to nova.conf
    Change-Id: Iebd415b5b3a9d2be42861220366135d2cb57b14d
    Closes-bug: #1287292

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote :

Here's the oslo.vmware review : https://review.openstack.org/#/c/91573/

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to oslo.vmware (master)

Reviewed: https://review.openstack.org/91573
Committed: https://git.openstack.org/cgit/openstack/oslo.vmware/commit/?id=a76bd253fb4fa54c72d3440f2345642b209b5f41
Submitter: Jenkins
Branch: master

commit a76bd253fb4fa54c72d3440f2345642b209b5f41
Author: Davanum Srinivas <email address hidden>
Date: Thu May 1 10:05:41 2014 -0400

    Support for IPv6 and Non-standard ports

    IPv6 urls are formatted with '[' and ']' around the host and
    the port actually shows up after the trailing ']' as well. So
    we need to allow for better support for both ipv6 and non
    standard urls when dealing with both SOAP and WSDL urls.

    Examples:
       https://[fd2e:1201:1d9f:0:8886:78e0:38cd:cb03]/sdk
       https://[::1]:9443/sdk/

    Closes-Bug: #1287292

    Change-Id: I84ab38087ea77a30f6082d8c3fae0341e3371a78

Changed in oslo:
status: New → Fix Committed
Thierry Carrez (ttx)
Changed in oslo:
milestone: none → juno-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: next → none
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.