lvm snapshot fails on --size with wrong string formating

Bug #1370520 reported by Arthur Lutz (Logilab)
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Invalid
Undecided
Unassigned

Bug Description

2014-09-17 15:33:32.019 11832 TRACE oslo.messaging.rpc.dispatcher Traceback (most recent call last):
2014-09-17 15:33:32.019 11832 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 134, in _dispatch_and_reply
2014-09-17 15:33:32.019 11832 TRACE oslo.messaging.rpc.dispatcher incoming.message))
2014-09-17 15:33:32.019 11832 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 177, in _dispatch
2014-09-17 15:33:32.019 11832 TRACE oslo.messaging.rpc.dispatcher return self._do_dispatch(endpoint, method, ctxt, args)
2014-09-17 15:33:32.019 11832 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 123, in _do_dispatch
2014-09-17 15:33:32.019 11832 TRACE oslo.messaging.rpc.dispatcher result = getattr(endpoint, method)(ctxt, **new_args)
2014-09-17 15:33:32.019 11832 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/cinder/volume/manager.py", line 484, in create_snapshot
2014-09-17 15:33:32.019 11832 TRACE oslo.messaging.rpc.dispatcher {'status': 'error'})
2014-09-17 15:33:32.019 11832 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/cinder/openstack/common/excutils.py", line 68, in __exit__
2014-09-17 15:33:32.019 11832 TRACE oslo.messaging.rpc.dispatcher six.reraise(self.type_, self.value, self.tb)
2014-09-17 15:33:32.019 11832 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/cinder/volume/manager.py", line 475, in create_snapshot
2014-09-17 15:33:32.019 11832 TRACE oslo.messaging.rpc.dispatcher model_update = self.driver.create_snapshot(snapshot_ref)
2014-09-17 15:33:32.019 11832 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/cinder/volume/drivers/lvm.py", line 240, in create_snapshot
2014-09-17 15:33:32.019 11832 TRACE oslo.messaging.rpc.dispatcher self.configuration.lvm_type)
2014-09-17 15:33:32.019 11832 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/cinder/brick/local_dev/lvm.py", line 505, in create_lv_snapshot
2014-09-17 15:33:32.019 11832 TRACE oslo.messaging.rpc.dispatcher run_as_root=True)
2014-09-17 15:33:32.019 11832 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/cinder/utils.py", line 136, in execute
2014-09-17 15:33:32.019 11832 TRACE oslo.messaging.rpc.dispatcher return processutils.execute(*cmd, **kwargs)
2014-09-17 15:33:32.019 11832 TRACE oslo.messaging.rpc.dispatcher File "/usr/lib/python2.7/dist-packages/cinder/openstack/common/processutils.py", line 173, in execute
2014-09-17 15:33:32.019 11832 TRACE oslo.messaging.rpc.dispatcher cmd=' '.join(cmd))
2014-09-17 15:33:32.019 11832 TRACE oslo.messaging.rpc.dispatcher ProcessExecutionError: Unexpected error while running command.
2014-09-17 15:33:32.019 11832 TRACE oslo.messaging.rpc.dispatcher Command: sudo cinder-rootwrap /etc/cinder/rootwrap.conf lvcreate --name _snapshot-688a1602-3f47-4410-89e3-e74d991d0d11 --snapshot cinder-volumes/volume-fdbc944f-042a-4c2a-9dfc-3fe952f2ab6e -L 2.00g
2014-09-17 15:33:32.019 11832 TRACE oslo.messaging.rpc.dispatcher Exit code: 3
2014-09-17 15:33:32.019 11832 TRACE oslo.messaging.rpc.dispatcher Stdout: ''
2014-09-17 15:33:32.019 11832 TRACE oslo.messaging.rpc.dispatcher Stderr: ' Invalid argument for --size: 2.00g\n Error during parsing of command line.\n'
2014-09-17 15:33:32.019 11832 TRACE oslo.messaging.rpc.dispatcher

A quick read of the code in /usr/lib/python2.7/dist-packages/cinder/brick/local_dev/lvm.py", line 505 makes me think that the simple fix would be to use '%ig' instead of '%sg' so that "--size 2g" is used instead of "--size 2.00g"

Revision history for this message
Jon Bernard (jbernard) wrote :

What command did you run to hit this error? Also can you include 'cinder list' output?

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

Yeah, as Jon pointed it out it would be great to get some more detail on this.

Also, size should be optional (some would argue not used/ignored) for snapshots anyway.

Revision history for this message
Arthur Lutz (Logilab) (arthur-lutz-logilab) wrote :

@jbernard : I am running a "create snapshot" from horizon.

cinder list gives me :

# cinder list
+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+
| ID | Status | Display Name | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+
| 6d1360fa-6624-4c6f-98d1-68743279f48d | available | fromcmd | 2 | None | false | |
| d083e915-b6d5-497f-9be4-151fded1eb5f | available | fromcmd | 2 | None | false | |
+--------------------------------------+-----------+--------------+------+-------------+----------+-------------+

nova volume-snapshot-create ID creates the same traceback.

$ nova volume-snapshot-show c329a035-bc2e-40e8-94b5-ca5f3bd86f99
+--------------------------------------------+--------------------------------------+
| Property | Value |
+--------------------------------------------+--------------------------------------+
| created_at | 2014-09-18T07:57:42.000000 |
| display_description | - |
| display_name | - |
| id | c329a035-bc2e-40e8-94b5-ca5f3bd86f99 |
| metadata | {} |
| os-extended-snapshot-attributes:progress | 0% |
| os-extended-snapshot-attributes:project_id | 988c8bec623e4793b32c6f841f8705f7 |
| size | 2 |
| status | error |
| volume_id | fdbc944f-042a-4c2a-9dfc-3fe952f2ab6e |
+--------------------------------------------+--------------------------------------+

Revision history for this message
git-harry (git-harry) wrote :

I've had a quick look, from what I can see the snapshot size is taken from the size of the volume. The volume size should be an integer. Commit 7ed28d1c has changed the api to check that the requested size of a new volume is an integer. The client and dashboard have enforced this for some time.

If this is still an issue for you it would be useful to confirm the version of OpenStack you are using as well as how you created the volume.

Revision history for this message
Arthur Lutz (Logilab) (arthur-lutz-logilab) wrote :

As far as I can remember the volume was created either through nova or through the dashboard. In both cases I use a simple "2" to create it, not a "2." or "2.0" or "2.00".

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: New → 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.