[openstack-dev] [Openstack] Boot instance from volume via Horizon dashboard fails
Eugen Block
eblock at nde.ag
Mon Mar 21 15:01:45 UTC 2016
Hi all,
I'm just a (new) Openstack user, not a developer, but I have a
question regarding the Horizon dashboard respectively launching
instances via dashboard.
I have a Liberty deployment running on 1 controller and 2 compute nodes.
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:
nova-compute.log:
[instance: 09f96335-4f3b-4b3e-a7b3-ef384144b00b] Booting with blank
volume at /dev/vda
libxl-driver.log:
2016-03-21 14:01:07 CET libxl: error: libxl.c:2733:device_disk_add:
Invalid or unsupported virtual disk identifier vda
2016-03-21 14:01:07 CET libxl: error:
libxl_create.c:1167:domcreate_launch_dm: unable to add disk devices
As I already said, this error doesn't occur if you use CLI.
So I tried to figure out, what the difference between nova boot and
Horizon is.
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():
---cut here---
device_name = forms.CharField(label=_("Device Name"),
required=False,
INITIAL="VDA",
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."))
---cut here---
Now if I make that field visible and change its value to XVDA,
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":
---cut here---
device_name = forms.CharField(label=_("Device Name"),
required=False,
INITIAL="",
---cut here---
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:
---cut here---
elif source_type == 'volume_image_id':
device_name = context.get('device_name', '').strip() or None
dev_mapping_2 = [
{'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})
---cut here---
This seems to work (for me), but I'm quite new to Openstack, so what
would your professional opinion be on this subject?
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.
I'm looking forward to your answer!
Regards,
Eugen
--
Eugen Block voice : +49-40-559 51 75
NDE Netzdesign und -entwicklung AG fax : +49-40-559 51 77
Postfach 61 03 15
D-22423 Hamburg e-mail : eblock at nde.ag
Vorsitzende des Aufsichtsrates: Angelika Mozdzen
Sitz und Registergericht: Hamburg, HRB 90934
Vorstand: Jens-U. Mozdzen
USt-IdNr. DE 814 013 983
More information about the OpenStack-dev
mailing list