Launching instance fails when Nova doesn't support DiskConfig

Bug #1326406 reported by Wu Hong Guang
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
High
Lin Hua Cheng

Bug Description

Setup: Nova does not support DiskConfig extension

Test step:

1: login as admin
2:go to Project->Computer->Instances
3:launch instance

I've attached the horizon_error.log

Revision history for this message
Wu Hong Guang (whg) wrote :
Changed in horizon:
assignee: nobody → Lin Hua Cheng (lin-hua-cheng)
status: New → Triaged
importance: Undecided → High
summary: - There was an error submitting the form when launching instance
+ Launching instance fails when Nova doesn't support DiskConfig
Revision history for this message
Lin Hua Cheng (lin-hua-cheng) wrote :

I can reproduce the issue when Nova does not support DiskConfig.

disk_config field is removed from the workflow if the Nova does not support it. (added in https://review.openstack.org/#/c/90284/)

However it is still accessed in the handle() method

      try:
            api.nova.server_create(request,
                                   ...
                                   disk_config=context['disk_config'])
            return True

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

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

Changed in horizon:
status: Triaged → In Progress
Revision history for this message
Loganathan Parthipan (parthipan) wrote :

Does nova handle the case if there's no disk_config specified?

Revision history for this message
Eric Peterson (ericpeterson-l) wrote :

still occuring, error is:

[Thu Jun 05 14:55:09 2014] [error] Internal Server Error: /project/instances/launch
[Thu Jun 05 14:55:09 2014] [error] Traceback (most recent call last):
[Thu Jun 05 14:55:09 2014] [error] File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line 112, in get_response
[Thu Jun 05 14:55:09 2014] [error] response = wrapped_callback(request, *callback_args, **callback_kwargs)
[Thu Jun 05 14:55:09 2014] [error] File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/decorators.py", line 36, in dec
[Thu Jun 05 14:55:09 2014] [error] return view_func(request, *args, **kwargs)
[Thu Jun 05 14:55:09 2014] [error] File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/decorators.py", line 52, in dec
[Thu Jun 05 14:55:09 2014] [error] return view_func(request, *args, **kwargs)
[Thu Jun 05 14:55:09 2014] [error] File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/decorators.py", line 36, in dec
[Thu Jun 05 14:55:09 2014] [error] return view_func(request, *args, **kwargs)
[Thu Jun 05 14:55:09 2014] [error] File "/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py", line 69, in view
[Thu Jun 05 14:55:09 2014] [error] return self.dispatch(request, *args, **kwargs)
[Thu Jun 05 14:55:09 2014] [error] File "/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py", line 87, in dispatch
[Thu Jun 05 14:55:09 2014] [error] return handler(request, *args, **kwargs)
[Thu Jun 05 14:55:09 2014] [error] File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/workflows/views.py", line 193, in post
[Thu Jun 05 14:55:09 2014] [error] exceptions.handle(request)
[Thu Jun 05 14:55:09 2014] [error] File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/workflows/views.py", line 188, in post
[Thu Jun 05 14:55:09 2014] [error] success = workflow.finalize()
[Thu Jun 05 14:55:09 2014] [error] File "/opt/stack/horizon/openstack_dashboard/wsgi/../../horizon/workflows/base.py", line 802, in finalize
[Thu Jun 05 14:55:09 2014] [error] if not self.handle(self.request, self.context):
[Thu Jun 05 14:55:09 2014] [error] File "/usr/local/lib/python2.7/dist-packages/django/views/decorators/debug.py", line 36, in sensitive_variables_wrapper
[Thu Jun 05 14:55:09 2014] [error] return func(*func_args, **func_kwargs)
[Thu Jun 05 14:55:09 2014] [error] File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/dashboards/project/instances/workflows/create_instance.py", line 758, in handle
[Thu Jun 05 14:55:09 2014] [error] exceptions.handle(request)
[Thu Jun 05 14:55:09 2014] [error] File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/dashboards/project/instances/workflows/create_instance.py", line 755, in handle
[Thu Jun 05 14:55:09 2014] [error] disk_config=context['disk_config'])
[Thu Jun 05 14:55:09 2014] [error] KeyError: 'disk_config'

Revision history for this message
Eric Peterson (ericpeterson-l) wrote :

problem is that a dict get call should have been used.....

            api.nova.server_create(request,
                                   context['name'],
                                   image_id,
                                   context['flavor'],
                                   context['keypair_id'],
                                   normalize_newlines(custom_script),
                                   context['security_group_ids'],
                                   block_device_mapping=dev_mapping_1,
                                   block_device_mapping_v2=dev_mapping_2,
                                   nics=nics,
                                   availability_zone=avail_zone,
                                   instance_count=int(context['count']),
                                   admin_pass=context['admin_pass'],
                                   disk_config=context['disk_config'])

Changed in horizon:
assignee: Lin Hua Cheng (lin-hua-cheng) → Eric Peterson (ericpeterson-l)
Changed in horizon:
assignee: Eric Peterson (ericpeterson-l) → nobody
Changed in horizon:
assignee: nobody → Lin Hua Cheng (lin-hua-cheng)
Revision history for this message
Lin Hua Cheng (lin-hua-cheng) wrote :

Loganathan: Yes, the None value of disk_config is just ignored.

Matthias Runge (mrunge)
tags: added: icehouse-backport-potential
Revision history for this message
Lin Hua Cheng (lin-hua-cheng) wrote :

Patch does not need to be backported, the bug was introduced by a patch that was merged in J-1: https://review.openstack.org/#/c/90284/

Julie Pichon (jpichon)
tags: removed: icehouse-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/98019
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=cb7b559f0fb52ddd8f6cf3475e0d59ef3f12a89c
Submitter: Jenkins
Branch: master

commit cb7b559f0fb52ddd8f6cf3475e0d59ef3f12a89c
Author: lin-hua-cheng <email address hidden>
Date: Wed Jun 4 21:00:23 2014 -0700

    Fix issue when Nova does not support DiskConfig

    When DiskConfig is not support by Nova, the disk_config field is
    removed from the form. This fix takes care of safely handling the
    case when the field is not available.

    Change-Id: I44727eb3fc44c209b3b8cf28ab89a45c7d3bcfa1
    Closes-Bug: #1326406

Changed in horizon:
status: In Progress → Fix Committed
Revision history for this message
Wu Hong Guang (whg) wrote :

This bug is fixed

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