Snapshot fail with LVM backend

Bug #1356909 reported by Ivan Arsenault
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Invalid
Undecided
Unassigned

Bug Description

Snapshot fail on Icehouse on Fedora 20 when using LVM backend.

In file /usr/lib/python2.7/site-packages/cinder/brick/local_dev/lvm.py

get_all_volumes at line 236 catch all volume information with this command :

lvs --noheadings --unit=g -o vg_name,name,size --nosuffix

Ex: cinder-volumes volume-d559cdde-8184-431e-afcf-56e81c68a348 100.00

But the size contain float like value. So to temporary correct snapshot at line 259
I changed

lv_list.append({"vg": vg, "name": name, "size": size})

by this ugly patch

lv_list.append({"vg": vg, "name": name, "size": str(int(float(size)))})

Now with that, snapshot work again.

Ivan

Revision history for this message
Duncan Thomas (duncan-thomas) wrote :

Are you using a LOCALE setting? I'm guessing so from the '100,00'.

Revision history for this message
Ivan Arsenault (ivan-arsenault) wrote :

Changed my bug description, now with LOCALE en_US.UTF8 I got 100.00 not 100,00 sorry for that :-)

Ivan

description: updated
Revision history for this message
John Griffith (john-griffith) wrote :

Hey Ivan,

Could you please include the command you used as well as the c-vol logs? Might be useful to know specific Locale used when this failed as well etc.

Changed in cinder:
status: New → Incomplete
Revision history for this message
Ivan Arsenault (ivan-arsenault) wrote : Re: [Bug 1356909] Re: Snapshot fail with LVM backend
Download full text (4.1 KiB)

Hi,
    there is the log I got without my patch :

volume.log:2014-09-19 12:48:23.608 31589 ERROR
oslo.messaging._drivers.common [req-b675b555-ca6a-4ae2-b845-be7547525c47
75a3c967a15a4487a406e9bbd79377b2 1860237e86e04d168c4e83151c6cd187 - - -]
['Traceback (most recent call last):\n', ' File
"/usr/lib/python2.7/site-packages/oslo/messaging/rpc/dispatcher.py", line
133, in _dispatch_and_reply\n incoming.message))\n', ' File
"/usr/lib/python2.7/site-packages/oslo/messaging/rpc/dispatcher.py", line
176, in _dispatch\n return self._do_dispatch(endpoint, method, ctxt,
args)\n', ' File
"/usr/lib/python2.7/site-packages/oslo/messaging/rpc/dispatcher.py", line
122, in _do_dispatch\n result = getattr(endpoint, method)(ctxt,
**new_args)\n', ' File
"/usr/lib/python2.7/site-packages/cinder/volume/manager.py", line 484, in
create_snapshot\n {\'status\': \'error\'})\n', ' File
"/usr/lib/python2.7/site-packages/cinder/openstack/common/excutils.py",
line 68, in __exit__\n six.reraise(self.type_, self.value, self.tb)\n',
' File "/usr/lib/python2.7/site-packages/cinder/volume/manager.py", line
475, in create_snapshot\n model_update =
self.driver.create_snapshot(snapshot_ref)\n', ' File
"/usr/lib/python2.7/site-packages/cinder/volume/drivers/lvm.py", line 240,
in create_snapshot\n self.configuration.lvm_type)\n', ' File
"/usr/lib/python2.7/site-packages/cinder/brick/local_dev/lvm.py", line 508,
in create_lv_snapshot\n run_as_root=True)\n', ' File
"/usr/lib/python2.7/site-packages/cinder/utils.py", line 136, in
execute\n return processutils.execute(*cmd, **kwargs)\n', ' File
"/usr/lib/python2.7/site-packages/cinder/openstack/common/processutils.py",
line 173, in execute\n cmd=\' \'.join(cmd))\n', "ProcessExecutionError:
Unexpected error while running command.\nCommand: sudo cinder-rootwrap
/etc/cinder/rootwrap.conf lvcreate --name
_snapshot-d27b3384-d47b-49ea-b00d-9199bf40a6fb --snapshot
cinder-volumes/volume-6b09c7db-842f-4f3b-a242-e7e7a5374507 -L 10.00g\nExit
code: 3\nStdout: ''\nStderr: ' Invalid argument for --size: 10.00g\\n
Error during parsing of command line.\\n'\n"]

That command is bad :

lvcreate --name _snapshot-d27b3384-d47b-49ea-b00d-9199bf40a6fb --snapshot
cinder-volumes/volume-6b09c7db-842f-4f3b-a242-e7e7a5374507 -L 10.00g

suppose to be

lvcreate --name _snapshot-d27b3384-d47b-49ea-b00d-9199bf40a6fb --snapshot
cinder-volumes/volume-6b09c7db-842f-4f3b-a242-e7e7a5374507 -L 10g

-L 10.00g is not correct, my ugly patch convert to 10g :-o

To get the size of the volume size, at line 236 get_all_volumes method list
all volume by calling :

lvs --noheadings --unit=g -o vg_name,name,size --nosuffix

but this command return invalid volume size value :

Ex:
[root@ptl-ariv1 cinder]# export LC_ALL=en_US.UTF8
[root@ptl-ariv1 cinder]# export LANG=en_US.UTF8
[root@ptl-ariv1 cinder]# locale
LANG=en_US.UTF8
LC_CTYPE="en_US.UTF8"
LC_NUMERIC="en_US.UTF8"
LC_TIME="en_US.UTF8"
LC_COLLATE="en_US.UTF8"
LC_MONETARY="en_US.UTF8"
LC_MESSAGES="en_US.UTF8"
LC_PAPER="en_US.UTF8"
LC_NAME="en_US.UTF8"
LC_ADDRESS="en_US.UTF8"
LC_TELEPHONE="en_US.UTF8"
LC_MEASUREMENT="en_US.UTF8"
LC_IDENTIFICATION="en_US.UTF8"
LC_ALL=en_US.UTF8
[root@ptl...

Read more...

Revision history for this message
Sean McGinnis (sean-mcginnis) wrote : Bug Cleanup

Closing stale bug. If this is still an issue please reopen.

Changed in cinder:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.