<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title></title>
</head>
<body style="font-family:Arial;font-size:14px">
<p>Hi all,<br>
<br>
I'm not subscribed to this list, usually I'm just a (new) Openstack user, but I have a question regarding the Horizon dashboard respectively launching instances via dashboard.<br>
<br>
I have a Liberty deployment running on 1 controller and 2 compute nodes.<br>
I also deployed an external cinder-volume as a storage backend for my instances. It works fine if you use the nova boot command (nova boot --block-device[...]) to launch instances or if you use kvm as hypervisor. But if you use xen (as I do) and you want to launch the instance via Horizon dashboard, you get an invalid block device mapping, because nova tries to attach /dev/vda as root device instead of /dev/xvda:<br>
<br>
nova-compute.log:<br>
<br>
[instance: 09f96335-4f3b-4b3e-a7b3-ef384144b00b] Booting with blank volume at /dev/vda<br>
<br>
libxl-driver.log:<br>
<br>
2016-03-21 14:01:07 CET libxl: error: libxl.c:2733:device_disk_add: Invalid or unsupported virtual disk identifier vda<br>
2016-03-21 14:01:07 CET libxl: error: libxl_create.c:1167:domcreate_launch_dm: unable to add disk devices<br>
<br>
<br>
As I already said, this error doesn't occur if you use CLI.<br>
So I tried to figure out, what the difference between nova boot and Horizon is.<br>
On controller node is the file /srv/www/openstack-dashboard/openstack_dashboard/dashboards/project/instances/workflows/create_instance.py which contains an assignment for the (by default) invisible field "can_set_mount_point" to the variable "device_name", here is a snippet from the class SetInstanceDetailsAction():<br>
<br>
---cut here---<br>
device_name = forms.CharField(label=_("Device Name"),<br>
required=False,<br>
<strong>initial="vda",</strong><br>
help_text=_("Volume mount point (e.g. 'vda' "<br>
"mounts at '/dev/vda'). Leave "<br>
"this field blank to let the "<br>
"system choose a device name "<br>
"for you."))<br>
---cut here---<br>
<br>
Now if I make that field visible and change its value to <strong>xvda,</strong> everything works fine and the VM is created successfully. So I made a minor change to see if it's more suitable for my environment, I changed the initial value of "device_name":<br>
<br>
---cut here---<br>
device_name = forms.CharField(label=_("Device Name"),<br>
required=False,<br>
<strong>initial="",</strong><br>
---cut here---<br>
<br>
and removed the assignment "{'device_name': device_name}" from the array "dev_mapping_2". Instead, I appended an if-statement to add the device_name only if it's not empty:<br>
<br>
---cut here---<br>
elif source_type == 'volume_image_id':<br>
device_name = context.get('device_name', '').strip() or None<br>
dev_mapping_2 = [<br>
{'source_type': 'image',<br>
'destination_type': 'volume',<br>
'delete_on_termination':<br>
bool(context['delete_on_terminate']),<br>
'uuid': context['source_id'],<br>
'boot_index': '0',<br>
'volume_size': context['volume_size']<br>
}<br>
]<br>
<strong> if device_name:<br>
dev_mapping_2.append({"device_name": device_name})</strong><br>
---cut here---<br>
<br>
This seems to work (for me), but I'm quite new to Openstack, so what would your professional opinion be on this subject?<br>
Of course, that if-statement would be also necessary if the "source_type" is "volume_snapshot_id", at least if this would be the way to go.<br>
<br>
I'm looking forward to your answer!<br>
<br>
Regards,<br>
Eugen</p>
<div>Eugen Block voice : +49-40-559 51 75<br>
NDE Netzdesign und -entwicklung AG fax : +49-40-559 51 77<br>
Postfach 61 03 15 <br>
D-22423 Hamburg e-mail : <a href="mailto:eblock@nde.ag">eblock@nde.ag</a><br>
<br>
Vorsitzende des Aufsichtsrates: Angelika Mozdzen<br>
Sitz und Registergericht: Hamburg, HRB 90934<br>
Vorstand: Jens-U. Mozdzen<br>
USt-IdNr. DE 814 013 983</div>
</body>
</html>