Re: [openstack-dev] [Openstack] Boot instance from volume via Horizon dashboard fails

2016-03-22 Thread Eugen Block

Hi, thanks for your response.

Having said that, there is probably a bug in Horizon since it's  
defaulting to vda for the device name when booting from volume.


I think so, too. I'm quite new to Openstack and not 100% sure about my  
statements, but I think my question is not a support issue. I'm trying  
to find the cause for the faulty results when launching instances from  
volume via dashboard.


The libvirt driver in nova ignores the requested device name in boot  
from volume / volume attach requests


Yes, I see that, too, in default_device_names_for_instance() the  
bdm.device_name is nulled out. But there is also a "root_device_name",  
which keeps the value provided by a user (CLI or Horizon) and this  
value is applied when trying to boot from that volume, which leads to  
an error. Shouldn't the root_device_name also be nulled out?


Sorry, if this is not the right channel to address this issue, I  
thought it was. So if it's not, what is the way to go here?


Regards,
Eugen

Zitat von Matt Riedemann :


On 3/21/2016 10:31 AM, Mike Perez wrote:

On 16:01 Mar 21, Eugen Block wrote:

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.


Hi Eugen!

Welcome to the community! This mailing list is development focused  
and not our
support channel. You can request help at our general mailing list  
[1], or Ask

OpenStack [2].

[1] - http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
[2] - https://ask.openstack.org/en/questions/



Having said that, there is probably a bug in Horizon since it's  
defaulting to vda for the device name when booting from volume.


The libvirt driver in nova ignores the requested device name in boot  
from volume / volume attach requests since Liberty [1]. It's best to  
let the virt driver in nova pick the device name, you can get the  
mountpoint via the volume attachment later after the volume's status  
is 'in-use'.


[1] https://review.openstack.org/#/c/189632/

--

Thanks,

Matt Riedemann


__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev




--
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  : ebl...@nde.ag

Vorsitzende des Aufsichtsrates: Angelika Mozdzen
  Sitz und Registergericht: Hamburg, HRB 90934
  Vorstand: Jens-U. Mozdzen
   USt-IdNr. DE 814 013 983


__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Openstack] Boot instance from volume via Horizon dashboard fails

2016-03-21 Thread Matt Riedemann



On 3/21/2016 10:31 AM, Mike Perez wrote:

On 16:01 Mar 21, Eugen Block wrote:

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.


Hi Eugen!

Welcome to the community! This mailing list is development focused and not our
support channel. You can request help at our general mailing list [1], or Ask
OpenStack [2].

[1] - http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
[2] - https://ask.openstack.org/en/questions/



Having said that, there is probably a bug in Horizon since it's 
defaulting to vda for the device name when booting from volume.


The libvirt driver in nova ignores the requested device name in boot 
from volume / volume attach requests since Liberty [1]. It's best to let 
the virt driver in nova pick the device name, you can get the mountpoint 
via the volume attachment later after the volume's status is 'in-use'.


[1] https://review.openstack.org/#/c/189632/

--

Thanks,

Matt Riedemann


__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


Re: [openstack-dev] [Openstack] Boot instance from volume via Horizon dashboard fails

2016-03-21 Thread Mike Perez
On 16:01 Mar 21, Eugen Block wrote:
> 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.

Hi Eugen!

Welcome to the community! This mailing list is development focused and not our
support channel. You can request help at our general mailing list [1], or Ask
OpenStack [2].

[1] - http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack
[2] - https://ask.openstack.org/en/questions/

-- 
Mike Perez

__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [Openstack] Boot instance from volume via Horizon dashboard fails

2016-03-21 Thread Eugen Block

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  : ebl...@nde.ag

Vorsitzende des Aufsichtsrates: Angelika Mozdzen
  Sitz und Registergericht: Hamburg, HRB 90934
  Vorstand: Jens-U. Mozdzen
   USt-IdNr. DE 814 013 983


__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev


[openstack-dev] [Openstack] Boot instance from volume via Horizon dashboard fails

2016-03-21 Thread Eugen Block

Hi all,

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.


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  :
ebl...@nde.ag

        Vorsitzende des Aufsichtsrates: Angelika Mozdzen
          Sitz und Registergericht: Hamburg, HRB 90934
                  Vorstand: Jens-U. Mozdzen
                   USt-IdNr. DE 814 013 983
__
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: openstack-dev-requ...@lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev