No validation error when only fixed_ip is specified for server resource.

Bug #1450901 reported by Job
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Undecided
Rabi Mishra

Bug Description

Juno
Ubuntu 14.04
VMWARE driver
Nova network
Heat

Heat template with fixed_ip fails. I already try with:

...
server:
  ...
      networks:
        - fixed_ip: {get_param: net_ip}
        - network: {get_param: net_a}
...

AND:
...
server:
  ...
      networks:
        - fixed_ip: {get_param: net_ip}
        - uuid: {get_param: net_a}
...

Error output:
/var/log/heat/heat-engine.log:2015-05-01 13:41:14.938 22303 INFO heat.engine.resource [-] CREATE: Server "server" Stack "p" [5243ada6-0a13-421b-af4c-3bbf91c060ee]
/var/log/heat/heat-engine.log:2015-05-01 13:41:14.938 22303 TRACE heat.engine.resource Traceback (most recent call last):
/var/log/heat/heat-engine.log:2015-05-01 13:41:14.938 22303 TRACE heat.engine.resource File "/usr/lib/python2.7/dist-packages/heat/engine/resource.py", line 439, in _action_recorder
/var/log/heat/heat-engine.log:2015-05-01 13:41:14.938 22303 TRACE heat.engine.resource yield
/var/log/heat/heat-engine.log:2015-05-01 13:41:14.938 22303 TRACE heat.engine.resource File "/usr/lib/python2.7/dist-packages/heat/engine/resource.py", line 509, in _do_action
/var/log/heat/heat-engine.log:2015-05-01 13:41:14.938 22303 TRACE heat.engine.resource yield self.action_handler_task(action, args=handler_args)
/var/log/heat/heat-engine.log:2015-05-01 13:41:14.938 22303 TRACE heat.engine.resource File "/usr/lib/python2.7/dist-packages/heat/engine/scheduler.py", line 286, in wrapper
/var/log/heat/heat-engine.log:2015-05-01 13:41:14.938 22303 TRACE heat.engine.resource step = next(subtask)
/var/log/heat/heat-engine.log:2015-05-01 13:41:14.938 22303 TRACE heat.engine.resource File "/usr/lib/python2.7/dist-packages/heat/engine/resource.py", line 480, in action_handler_task
/var/log/heat/heat-engine.log:2015-05-01 13:41:14.938 22303 TRACE heat.engine.resource handler_data = handler(*args)
/var/log/heat/heat-engine.log:2015-05-01 13:41:14.938 22303 TRACE heat.engine.resource File "/usr/lib/python2.7/dist-packages/heat/engine/resources/server.py", line 546, in handle_create
/var/log/heat/heat-engine.log:2015-05-01 13:41:14.938 22303 TRACE heat.engine.resource admin_pass=admin_pass)
/var/log/heat/heat-engine.log:2015-05-01 13:41:14.938 22303 TRACE heat.engine.resource File "/usr/lib/python2.7/dist-packages/novaclient/v1_1/servers.py", line 883, in create
/var/log/heat/heat-engine.log:2015-05-01 13:41:14.938 22303 TRACE heat.engine.resource **boot_kwargs)
/var/log/heat/heat-engine.log:2015-05-01 13:41:14.938 22303 TRACE heat.engine.resource File "/usr/lib/python2.7/dist-packages/novaclient/v1_1/servers.py", line 546, in _boot
/var/log/heat/heat-engine.log:2015-05-01 13:41:14.938 22303 TRACE heat.engine.resource return_raw=return_raw, **kwargs)
/var/log/heat/heat-engine.log:2015-05-01 13:41:14.938 22303 TRACE heat.engine.resource File "/usr/lib/python2.7/dist-packages/novaclient/base.py", line 100, in _create
/var/log/heat/heat-engine.log:2015-05-01 13:41:14.938 22303 TRACE heat.engine.resource _resp, body = self.api.client.post(url, body=body)
/var/log/heat/heat-engine.log:2015-05-01 13:41:14.938 22303 TRACE heat.engine.resource File "/usr/lib/python2.7/dist-packages/novaclient/client.py", line 490, in post
/var/log/heat/heat-engine.log:2015-05-01 13:41:14.938 22303 TRACE heat.engine.resource return self._cs_request(url, 'POST', **kwargs)
/var/log/heat/heat-engine.log:2015-05-01 13:41:14.938 22303 TRACE heat.engine.resource File "/usr/lib/python2.7/dist-packages/novaclient/client.py", line 465, in _cs_request
/var/log/heat/heat-engine.log:2015-05-01 13:41:14.938 22303 TRACE heat.engine.resource resp, body = self._time_request(url, method, **kwargs)
/var/log/heat/heat-engine.log:2015-05-01 13:41:14.938 22303 TRACE heat.engine.resource File "/usr/lib/python2.7/dist-packages/novaclient/client.py", line 439, in _time_request
/var/log/heat/heat-engine.log:2015-05-01 13:41:14.938 22303 TRACE heat.engine.resource resp, body = self.request(url, method, **kwargs)
/var/log/heat/heat-engine.log:2015-05-01 13:41:14.938 22303 TRACE heat.engine.resource File "/usr/lib/python2.7/dist-packages/novaclient/client.py", line 433, in request
/var/log/heat/heat-engine.log:2015-05-01 13:41:14.938 22303 TRACE heat.engine.resource raise exceptions.from_response(resp, body, url, method)
/var/log/heat/heat-engine.log:2015-05-01 13:41:14.938 22303 TRACE heat.engine.resource BadRequest: Bad network format: missing 'uuid' (HTTP 400) (Request-ID: req-93d827f5-f586-406b-bd11-35ede2b21a00)
/var/log/heat/heat-engine.log:2015-05-01 13:41:14.938 22303 TRACE heat.engine.resource

Rabi Mishra (rabi)
Changed in heat:
status: New → Confirmed
assignee: nobody → Rabi Mishra (rabi)
Rabi Mishra (rabi)
Changed in heat:
status: Confirmed → Invalid
assignee: Rabi Mishra (rabi) → nobody
status: Invalid → Confirmed
assignee: nobody → Rabi Mishra (rabi)
Revision history for this message
Rabi Mishra (rabi) wrote :

It seems your template is wrong. 'networks' property takes a list of networks. If you want to specify a fixed_ip for a specific network, you can specify like below.

      networks:
        - network: {get_param: net_a}
          fixed_ip: {get_param: net_ip}

In your case it's assuming you are specifying 2 networks. the one with 'fixed_ip' is without a network. There should be a validation not to allow fixed_ip without specifying a network.

Rabi Mishra (rabi)
summary: - BadRequest: Bad network format: missing 'uuid' (HTTP 400)
+ No error when neither uuid or network_id is specifed for server
+ resource.
summary: - No error when neither uuid or network_id is specifed for server
+ No error when neither uuid nor network_id is specified for server
resource.
Rabi Mishra (rabi)
summary: - No error when neither uuid nor network_id is specified for server
- resource.
+ No validation error when neither uuid nor network_id is specified for
+ server resource.
summary: - No validation error when neither uuid nor network_id is specified for
- server resource.
+ No validation error when only fixed_ip is specified for server resource.
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

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

Changed in heat:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/179574
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=a3089a63e8a3c67d898e700543d08d6cb40d18cc
Submitter: Jenkins
Branch: master

commit a3089a63e8a3c67d898e700543d08d6cb40d18cc
Author: Rabi Mishra <email address hidden>
Date: Sat May 2 14:07:27 2015 +0530

    Add validation to set one of network, port or uuid

    Add validation to set one of network, port or uuid
    properties for a server network.

    Change-Id: I01449fb237f0641a4f97bdf7c91f2ab8600a61f3
    Closes-Bug: #1450901

Changed in heat:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

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

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

Reviewed: https://review.openstack.org/187146
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=462924cc68b4076a10b3b59081a86d1ffb39cd23
Submitter: Jenkins
Branch: master

commit 462924cc68b4076a10b3b59081a86d1ffb39cd23
Author: Rabi Mishra <email address hidden>
Date: Sat May 2 14:07:27 2015 +0530

    Add validation to set one of network, port or uuid

    Add validation to set one of network, port or uuid
    properties for a server network.

    Change-Id: I703717426c27916b46f8508265bd387a66fcebad
    Closes-Bug: #1450901

Thierry Carrez (ttx)
Changed in heat:
milestone: none → liberty-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: liberty-1 → 5.0.0
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.