You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@libcloud.apache.org by an...@accenture.com on 2015/10/01 07:29:46 UTC

device parameter errors out while attaching a volume in openstack

Hi,

While attaching a volume to an instance in Openstack, if I omit the device name or if I specify the device name as auto, attach_volume call errors out.

Traceback (most recent call last):
  File "attach_volume_v1.py", line 44, in <module>
    success = driver.attach_volume(instances[0], volumes[0], device = 'auto')
  File "/usr/lib/python2.7/site-packages/libcloud/compute/drivers/openstack.py", line 226, in attach_volume
    'device': device,
  File "/usr/lib/python2.7/site-packages/libcloud/common/openstack.py", line 202, in request
    raw=raw)
  File "/usr/lib/python2.7/site-packages/libcloud/common/base.py", line 799, in request
    response = responseCls(**kwargs)
  File "/usr/lib/python2.7/site-packages/libcloud/compute/drivers/openstack.py", line 1001, in __init__
    super(OpenStack_1_1_Response, self).__init__(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/libcloud/common/base.py", line 143, in __init__
    headers=self.headers)
libcloud.common.exceptions.BaseHTTPError: 400  The supplied device path (auto) is invalid.


--
Greetings,
Anu Bhaskar

________________________________

This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of internal compliance with Accenture policy.
______________________________________________________________________________________

www.accenture.com

Re: device parameter errors out while attaching a volume in openstack

Posted by anu <an...@opencollective.in>.
Hi Markos,



Setting device parameter to None resolved the error. Openstack is now automatically assigning a device.

driver.attach_volume(instances[0], volumes[0], device = None)



However omitting device parameter resulted in same error.



--

Greetings

Anu Bhaskar





 ---- On Thu, 01 Oct 2015 13:07:15 +0530 Markos Gogoulos &lt;mgogoulos@mist.io&gt; wrote ----




Hi, 

 

I haven't used these functions, but I see on 

http://developer.openstack.org/api-ref-compute-v2-ext.html the device 

parameter should be provided as 

 

"Name of the device such as, /dev/vdb. Omit or set this parameter to null 

for auto-assignment, if supported. If you specify this parameter, the 

device must not exist in the guest operating system." 

 

Seems that the 'auto' is reserved by the system, so attach_volume function 

of compute.drivers.openstack.py should omit this parameter if it is not 

specified (or if it is specified as 'auto'). 

 

Regards, 

Markos 

 

 

 

 

 

On Thu, Oct 1, 2015 at 8:29 AM, &lt;anu.bhaskar.babu@accenture.com&gt; wrote: 

 

&gt; Hi, 

&gt; 

&gt; While attaching a volume to an instance in Openstack, if I omit the device 

&gt; name or if I specify the device name as auto, attach_volume call errors out. 

&gt; 

&gt; Traceback (most recent call last): 

&gt; File "attach_volume_v1.py", line 44, in &lt;module&gt; 

&gt; success = driver.attach_volume(instances[0], volumes[0], device = 

&gt; 'auto') 

&gt; File 

&gt; "/usr/lib/python2.7/site-packages/libcloud/compute/drivers/openstack.py", 

&gt; line 226, in attach_volume 

&gt; 'device': device, 

&gt; File "/usr/lib/python2.7/site-packages/libcloud/common/openstack.py", 

&gt; line 202, in request 

&gt; raw=raw) 

&gt; File "/usr/lib/python2.7/site-packages/libcloud/common/base.py", line 

&gt; 799, in request 

&gt; response = responseCls(**kwargs) 

&gt; File 

&gt; "/usr/lib/python2.7/site-packages/libcloud/compute/drivers/openstack.py", 

&gt; line 1001, in __init__ 

&gt; super(OpenStack_1_1_Response, self).__init__(*args, **kwargs) 

&gt; File "/usr/lib/python2.7/site-packages/libcloud/common/base.py", line 

&gt; 143, in __init__ 

&gt; headers=self.headers) 

&gt; libcloud.common.exceptions.BaseHTTPError: 400 The supplied device path 

&gt; (auto) is invalid. 

&gt; 

&gt; 

&gt; -- 

&gt; Greetings, 

&gt; Anu Bhaskar 

&gt; 

&gt; ________________________________ 

&gt; 

&gt; This message is for the designated recipient only and may contain 

&gt; privileged, proprietary, or otherwise confidential information. If you have 

&gt; received it in error, please notify the sender immediately and delete the 

&gt; original. Any other use of the e-mail by you is prohibited. Where allowed 

&gt; by local law, electronic communications with Accenture and its affiliates, 

&gt; including e-mail and instant messaging (including content), may be scanned 

&gt; by our systems for the purposes of information security and assessment of 

&gt; internal compliance with Accenture policy. 

&gt; 

&gt; ______________________________________________________________________________________ 

&gt; 

&gt; www.accenture.com 

&gt; 







Re: device parameter errors out while attaching a volume in openstack

Posted by Markos Gogoulos <mg...@mist.io>.
Hi,

I haven't used these functions, but I see on
http://developer.openstack.org/api-ref-compute-v2-ext.html the device
parameter should be provided as

"Name of the device such as, /dev/vdb. Omit or set this parameter to null
for auto-assignment, if supported. If you specify this parameter, the
device must not exist in the guest operating system."

Seems that the 'auto' is reserved by the system, so attach_volume function
of compute.drivers.openstack.py should omit this parameter if it is not
specified (or if it is specified as 'auto').

Regards,
Markos





On Thu, Oct 1, 2015 at 8:29 AM, <an...@accenture.com> wrote:

> Hi,
>
> While attaching a volume to an instance in Openstack, if I omit the device
> name or if I specify the device name as auto, attach_volume call errors out.
>
> Traceback (most recent call last):
>   File "attach_volume_v1.py", line 44, in <module>
>     success = driver.attach_volume(instances[0], volumes[0], device =
> 'auto')
>   File
> "/usr/lib/python2.7/site-packages/libcloud/compute/drivers/openstack.py",
> line 226, in attach_volume
>     'device': device,
>   File "/usr/lib/python2.7/site-packages/libcloud/common/openstack.py",
> line 202, in request
>     raw=raw)
>   File "/usr/lib/python2.7/site-packages/libcloud/common/base.py", line
> 799, in request
>     response = responseCls(**kwargs)
>   File
> "/usr/lib/python2.7/site-packages/libcloud/compute/drivers/openstack.py",
> line 1001, in __init__
>     super(OpenStack_1_1_Response, self).__init__(*args, **kwargs)
>   File "/usr/lib/python2.7/site-packages/libcloud/common/base.py", line
> 143, in __init__
>     headers=self.headers)
> libcloud.common.exceptions.BaseHTTPError: 400  The supplied device path
> (auto) is invalid.
>
>
> --
> Greetings,
> Anu Bhaskar
>
> ________________________________
>
> This message is for the designated recipient only and may contain
> privileged, proprietary, or otherwise confidential information. If you have
> received it in error, please notify the sender immediately and delete the
> original. Any other use of the e-mail by you is prohibited. Where allowed
> by local law, electronic communications with Accenture and its affiliates,
> including e-mail and instant messaging (including content), may be scanned
> by our systems for the purposes of information security and assessment of
> internal compliance with Accenture policy.
>
> ______________________________________________________________________________________
>
> www.accenture.com
>