← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1047568] Re: Essex version of Horizon sends null volume size value on boot from volume

 

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

** Changed in: horizon
       Status: Expired => In Progress

** Changed in: horizon
     Assignee: (unassigned) => Dirk Mueller (dmllr)

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1047568

Title:
  Essex version of Horizon sends null volume size value on boot from
  volume

Status in OpenStack Dashboard (Horizon):
  In Progress

Bug description:
  When I try to boot from volume using Horizon, the instance fails
  because Horizon sends a null value for volume size for
  block_device_mapping.

  Instead of it booting the volume like this with an integer in the size field:
  nova boot --image <some-image-uuid> --flavor m1.small --security_group=default --block_device_mapping vda=14::0:0 bov-test

  It sends it like this, which fails:
  nova boot --image  <some-image-uuid> --flavor m1.small --security_group=default --block_device_mapping vda=14:::0 bov-test

  
  The issue seems to be with the create method in horizon-2012.1/horizon/dashboards/nova/images_and_snapshots/images/forms.py at line 168 where it does the dev_mapping: 

  def handle(self, request, data):
          try:
              if(len(data['volume']) > 0):
                  if(data['delete_on_terminate']):
                      delete_on_terminate = 1
                  else:
                      delete_on_terminate = 0
                  dev_mapping = {data['device_name']:
                         ("%s::%s" % (data['volume'], delete_on_terminate))}
              else:
                  dev_mapping = None

              api.server_create(request,
                                data['name'],
                                data['image_id'],
                                data['flavor'],
                                data.get('keypair'),
                                normalize_newlines(data.get('user_data')),
                                data.get('security_groups'),
                                dev_mapping,
                                instance_count=data.get('count'))
              messages.success(request,
                           _('Instance "%s" launched.') % data["name"])
          except:
              redirect = reverse("horizon:nova:images_and_snapshots:index")
              exceptions.handle(request,
                                _('Unable to launch instance: %(exc)s'),
                                redirect=redirect)
          return shortcuts.redirect('horizon:nova:instances_and_volumes:index')

  This is the stacktrace from nova-api.log: 
  2012-09-07 13:59:17 DEBUG nova.compute.api [req-3817383a-fb2c-425e-97aa-96c54207754f eb6841a6dbee422a995f097b59522ab8 3dd94d30631b421a807273354a44e820] block_device_mapping [{u'volume_size': u'', u'device_name': u'vda', u'delete_on_termination': u'0', u'volume_id': u'14'}] from (pid=18897) _update_block_device_mapping /usr/lib/python2.7/dist-packages/nova/compute/api.py:481
  2012-09-07 13:59:17 ERROR nova.exception [req-3817383a-fb2c-425e-97aa-96c54207754f eb6841a6dbee422a995f097b59522ab8 3dd94d30631b421a807273354a44e820] DB exception wrapped.
  2012-09-07 13:59:17 TRACE nova.exception Traceback (most recent call last):
  2012-09-07 13:59:17 TRACE nova.exception   File "/usr/lib/python2.7/dist-packages/nova/exception.py", line 90, in _wrap
  2012-09-07 13:59:17 TRACE nova.exception     return f(*args, **kwargs)
  2012-09-07 13:59:17 TRACE nova.exception   File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 1547, in flush
  2012-09-07 13:59:17 TRACE nova.exception     self._flush(objects)
  2012-09-07 13:59:17 TRACE nova.exception   File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/session.py", line 1616, in _flush
  2012-09-07 13:59:17 TRACE nova.exception     flush_context.execute()
  2012-09-07 13:59:17 TRACE nova.exception   File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/unitofwork.py", line 328, in execute
  2012-09-07 13:59:17 TRACE nova.exception     rec.execute(self)
  2012-09-07 13:59:17 TRACE nova.exception   File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/unitofwork.py", line 472, in execute
  2012-09-07 13:59:17 TRACE nova.exception     uow
  2012-09-07 13:59:17 TRACE nova.exception   File "/usr/lib/python2.7/dist-packages/sqlalchemy/orm/mapper.py", line 2291, in _save_obj
  2012-09-07 13:59:17 TRACE nova.exception     execute(statement, params)
  2012-09-07 13:59:17 TRACE nova.exception   File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1405, in execute
  2012-09-07 13:59:17 TRACE nova.exception     params)
  2012-09-07 13:59:17 TRACE nova.exception   File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1538, in _execute_clauseelement
  2012-09-07 13:59:17 TRACE nova.exception     compiled_sql, distilled_params
  2012-09-07 13:59:17 TRACE nova.exception   File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1646, in _execute_context
  2012-09-07 13:59:17 TRACE nova.exception     context)
  2012-09-07 13:59:17 TRACE nova.exception   File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1639, in _execute_context
  2012-09-07 13:59:17 TRACE nova.exception     context)
  2012-09-07 13:59:17 TRACE nova.exception   File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 330, in do_execute
  2012-09-07 13:59:17 TRACE nova.exception     cursor.execute(statement, parameters)
  2012-09-07 13:59:17 TRACE nova.exception DataError: (DataError) invalid input syntax for integer: ""
  2012-09-07 13:59:17 TRACE nova.exception LINE 1: ...L, NULL, false, 52, 'vda', '0', NULL, NULL, '14', '', NULL, ...
  2012-09-07 13:59:17 TRACE nova.exception                                                              ^
  2012-09-07 13:59:17 TRACE nova.exception  'INSERT INTO block_device_mapping (created_at, updated_at, deleted_at, deleted, instance_id, device_name, delete_on_termination, virtual_name, snapshot_id, volume_id, volume_size, no_device, connection_info) VALUES (%(created_at)s, %(updated_at)s, %(deleted_at)s, %(deleted)s, %(instance_id)s, %(device_name)s, %(delete_on_termination)s, %(virtual_name)s, %(snapshot_id)s, %(volume_id)s, %(volume_size)s, %(no_device)s, %(connection_info)s) RETURNING block_device_mapping.id' {'virtual_name': None, 'no_device': None, 'connection_info': None, 'created_at': datetime.datetime(2012, 9, 7, 17, 59, 17, 975065), 'volume_id': u'14', 'deleted': False, 'updated_at': None, 'device_name': u'vda', 'instance_id': 52, 'volume_size': u'', 'snapshot_id': None, 'deleted_at': None, 'delete_on_termination': u'0'}
  2012-09-07 13:59:17 TRACE nova.exception 
  2012-09-07 13:59:17 ERROR nova.api.openstack [req-3817383a-fb2c-425e-97aa-96c54207754f eb6841a6dbee422a995f097b59522ab8 3dd94d30631b421a807273354a44e820] Caught error: (DataError) invalid input syntax for integer: ""
  LINE 1: ...L, NULL, false, 52, 'vda', '0', NULL, NULL, '14', '', NULL, ...
                                                               ^
   'INSERT INTO block_device_mapping (created_at, updated_at, deleted_at, deleted, instance_id, device_name, delete_on_termination, virtual_name, snapshot_id, volume_id, volume_size, no_device, connection_info) VALUES (%(created_at)s, %(updated_at)s, %(deleted_at)s, %(deleted)s, %(instance_id)s, %(device_name)s, %(delete_on_termination)s, %(virtual_name)s, %(snapshot_id)s, %(volume_id)s, %(volume_size)s, %(no_device)s, %(connection_info)s) RETURNING block_device_mapping.id' {'virtual_name': None, 'no_device': None, 'connection_info': None, 'created_at': datetime.datetime(2012, 9, 7, 17, 59, 17, 975065), 'volume_id': u'14', 'deleted': False, 'updated_at': None, 'device_name': u'vda', 'instance_id': 52, 'volume_size': u'', 'snapshot_id': None, 'deleted_at': None, 'delete_on_termination': u'0'}

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1047568/+subscriptions