assigning port to instance gives 401 from nova

Bug #1431522 reported by Harm Weites
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Invalid
Undecided
Unassigned

Bug Description

I'm trying to create an instance with a floating IP, and heat fails.

My template is as follows:
---
heat_template_version: 2014-10-16

description: Illustration to create a single instance with a floating ip.

resources:
  instance_1_port:
    type: OS::Neutron::Port
    properties:
      network: wts-net-01
      security_groups:
        - default

  instance_1:
    type: OS::Nova::Server
    properties:
      image: "Ubuntu 14.04"
      flavor: m1.small
      key_name: harm-at-manbearpig
      networks:
# - port: { get_resource: instance_1_port }
         - network: wts-net-01

  floating_ip:
    type: OS::Neutron::FloatingIP
    properties:
      floating_network: world

  floating_ip_assoc:
    type: OS::Neutron::FloatingIPAssociation
    properties:
      floatingip_id: { get_resource: floating_ip }
      port_id: { get_resource: instance_1_port }

outputs:
  instance_1_name:
    description: Name of instance
    value: { get_attr: [instance_1, name] }
  instance_ip:
    description: External floating IP
    value: { get_attr: [floating_ip, floating_ip_address] }
---

Now when using it as the above, all goes well and everything is created just fine (though without floatingip mapping). When I replace the instance_1 networks: part to use the specified port I receive an error from nova, which originates from Neutron:

2015-03-12 20:04:30.838 30609 INFO heat.engine.stack [-] Stack CREATE FAILED (test-setup): Resource CREATE failed: ClientException: The server has either erred or is incapable of performing the requested operation. (HTTP 500) (Request-ID: req-b138a707-c348-411f-88b8-d954428defc4)
2015-03-12 20:04:30.845 30609 INFO heat.engine.service [-] Stack create failed, status FAILED

2015-03-12 20:04:29.666 1993 TRACE nova.api.openstack rv = f(*args, **kwargs)
2015-03-12 20:04:29.666 1993 TRACE nova.api.openstack File "/usr/lib/python2.7/site-packages/nova/compute/api.py", line 1447, in create
2015-03-12 20:04:29.666 1993 TRACE nova.api.openstack check_server_group_quota=check_server_group_quota)
2015-03-12 20:04:29.666 1993 TRACE nova.api.openstack File "/usr/lib/python2.7/site-packages/nova/compute/api.py", line 1069, in _create_instance
2015-03-12 20:04:29.666 1993 TRACE nova.api.openstack max_count)
2015-03-12 20:04:29.666 1993 TRACE nova.api.openstack File "/usr/lib/python2.7/site-packages/nova/compute/api.py", line 804, in _validate_and_build_base_options
2015-03-12 20:04:29.666 1993 TRACE nova.api.openstack pci_request_info, requested_networks)
2015-03-12 20:04:29.666 1993 TRACE nova.api.openstack File "/usr/lib/python2.7/site-packages/nova/network/neutronv2/api.py", line 750, in create_pci_requests_for_sriov_ports
2015-03-12 20:04:29.666 1993 TRACE nova.api.openstack context, neutron, request_net.port_id)
2015-03-12 20:04:29.666 1993 TRACE nova.api.openstack File "/usr/lib/python2.7/site-packages/nova/network/neutronv2/api.py", line 723, in _get_port_vnic_info
2015-03-12 20:04:29.666 1993 TRACE nova.api.openstack fields=['binding:vnic_type', 'network_id']).get('port')
2015-03-12 20:04:29.666 1993 TRACE nova.api.openstack File "/usr/lib/python2.7/site-packages/nova/network/neutronv2/__init__.py", line 84, in wrapper
2015-03-12 20:04:29.666 1993 TRACE nova.api.openstack ret = obj(*args, **kwargs)
2015-03-12 20:04:29.666 1993 TRACE nova.api.openstack File "/usr/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 98, in with_params
2015-03-12 20:04:29.666 1993 TRACE nova.api.openstack ret = self.function(instance, *args, **kwargs)
2015-03-12 20:04:29.666 1993 TRACE nova.api.openstack File "/usr/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 317, in show_port
2015-03-12 20:04:29.666 1993 TRACE nova.api.openstack return self.get(self.port_path % (port), params=_params)
2015-03-12 20:04:29.666 1993 TRACE nova.api.openstack File "/usr/lib/python2.7/site-packages/nova/network/neutronv2/__init__.py", line 84, in wrapper
2015-03-12 20:04:29.666 1993 TRACE nova.api.openstack ret = obj(*args, **kwargs)
2015-03-12 20:04:29.666 1993 TRACE nova.api.openstack File "/usr/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 1320, in get
2015-03-12 20:04:29.666 1993 TRACE nova.api.openstack headers=headers, params=params)
2015-03-12 20:04:29.666 1993 TRACE nova.api.openstack File "/usr/lib/python2.7/site-packages/nova/network/neutronv2/__init__.py", line 84, in wrapper
2015-03-12 20:04:29.666 1993 TRACE nova.api.openstack ret = obj(*args, **kwargs)
2015-03-12 20:04:29.666 1993 TRACE nova.api.openstack File "/usr/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 1297, in retry_request
2015-03-12 20:04:29.666 1993 TRACE nova.api.openstack headers=headers, params=params)
2015-03-12 20:04:29.666 1993 TRACE nova.api.openstack File "/usr/lib/python2.7/site-packages/nova/network/neutronv2/__init__.py", line 84, in wrapper
2015-03-12 20:04:29.666 1993 TRACE nova.api.openstack ret = obj(*args, **kwargs)
2015-03-12 20:04:29.666 1993 TRACE nova.api.openstack File "/usr/lib/python2.7/site-packages/neutronclient/v2_0/client.py", line 1232, in do_request
2015-03-12 20:04:29.666 1993 TRACE nova.api.openstack self.httpclient.authenticate_and_fetch_endpoint_url()
2015-03-12 20:04:29.666 1993 TRACE nova.api.openstack File "/usr/lib/python2.7/site-packages/neutronclient/client.py", line 150, in authenticate_and_fetch_endpoint_url
2015-03-12 20:04:29.666 1993 TRACE nova.api.openstack self.authenticate()
2015-03-12 20:04:29.666 1993 TRACE nova.api.openstack File "/usr/lib/python2.7/site-packages/neutronclient/client.py", line 247, in authenticate
2015-03-12 20:04:29.666 1993 TRACE nova.api.openstack self._authenticate_keystone()
2015-03-12 20:04:29.666 1993 TRACE nova.api.openstack File "/usr/lib/python2.7/site-packages/neutronclient/client.py", line 226, in _authenticate_keystone
2015-03-12 20:04:29.666 1993 TRACE nova.api.openstack allow_redirects=True)
2015-03-12 20:04:29.666 1993 TRACE nova.api.openstack File "/usr/lib/python2.7/site-packages/neutronclient/client.py", line 136, in _cs_request
2015-03-12 20:04:29.666 1993 TRACE nova.api.openstack raise exceptions.Unauthorized(message=body)
2015-03-12 20:04:29.666 1993 TRACE nova.api.openstack Unauthorized: {"error": {"message": "The request you have made requires authentication.", "code": 401, "title": "Unauthorized"}}
2015-03-12 20:04:29.666 1993 TRACE nova.api.openstack

Revision history for this message
huangtianhua (huangtianhua) wrote :

I can't reproduce this bug in master.
What's version of your?

Revision history for this message
Harm Weites (harmw) wrote :

I'm running Juno: openstack-heat-common-2014.2.1-1.el7.centos.noarch

Revision history for this message
Harm Weites (harmw) wrote :

Upgraded and the issue is resolved.

openstack-heat-api-cfn-2014.2.2-1.el7.noarch
openstack-heat-common-2014.2.2-1.el7.noarch
openstack-heat-engine-2014.2.2-1.el7.noarch
openstack-heat-api-2014.2.2-1.el7.noarch
openstack-heat-api-cloudwatch-2014.2.2-1.el7.noarch
python-heatclient-0.2.12-2.el7.centos.noarch

Changed in heat:
status: New → Invalid
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.