--- /srv/www/openstack-dashboard/openstack_dashboard/dashboards/project/instances/workflows/create_instance.py.dist 2016-03-18 10:40:51.123942306 +0100 +++ /srv/www/openstack-dashboard/openstack_dashboard/dashboards/project/instances/workflows/create_instance.py 2016-03-24 11:49:00.404537704 +0100 @@ -119,11 +119,11 @@ help_text=_("Volume size in gigabytes " "(integer value).")) device_name = forms.CharField(label=_("Device Name"), required=False, - initial="vda", + initial="", help_text=_("Volume mount point (e.g. 'vda' " "mounts at '/dev/vda'). Leave " "this field blank to let the " "system choose a device name " "for you.")) @@ -878,20 +878,23 @@ dev_source_type_mapping = { 'volume_id': 'volume', 'volume_snapshot_id': 'snapshot' } dev_mapping_2 = [ - {'device_name': device_name, + { 'source_type': dev_source_type_mapping[source_type], 'destination_type': 'volume', 'delete_on_termination': bool(context['delete_on_terminate']), 'uuid': volume_source_id, 'boot_index': '0', 'volume_size': context['volume_size'] } ] + if device_name: + dev_mapping_2.append({"device_name": device_name}) + else: dev_mapping_1 = {context['device_name']: '%s::%s' % (context['source_id'], bool(context['delete_on_terminate'])) } @@ -900,20 +903,22 @@ exceptions.handle(request, msg) elif source_type == 'volume_image_id': device_name = context.get('device_name', '').strip() or None dev_mapping_2 = [ - {'device_name': device_name, # None auto-selects device + { 'source_type': 'image', 'destination_type': 'volume', 'delete_on_termination': bool(context['delete_on_terminate']), 'uuid': context['source_id'], 'boot_index': '0', 'volume_size': context['volume_size'] } ] + if device_name: + dev_mapping_2.append({"device_name": device_name}) netids = context.get('network_id', None) if netids: nics = [{"net-id": netid, "v4-fixed-ip": ""} for netid in netids]