LVM Thin pool free space calculation fails if pool not activated

Bug #1260773 reported by Eric Harney on 2013-12-13
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Medium
Eric Harney
Havana
Undecided
Unassigned

Bug Description

We should always activate the pool at initialization time since we are going to use it anyway.

2013-12-13 10:05:14.095 TRACE cinder.service File "/opt/stack/cinder/cinder/service.py", line 205, in _child_process
2013-12-13 10:05:14.095 TRACE cinder.service launcher.run_server(server)
2013-12-13 10:05:14.095 TRACE cinder.service File "/opt/stack/cinder/cinder/service.py", line 96, in run_server
2013-12-13 10:05:14.095 TRACE cinder.service server.start()
2013-12-13 10:05:14.095 TRACE cinder.service File "/opt/stack/cinder/cinder/service.py", line 388, in start
2013-12-13 10:05:14.095 TRACE cinder.service self.manager.init_host()
2013-12-13 10:05:14.095 TRACE cinder.service File "/opt/stack/cinder/cinder/volume/manager.py", line 286, in init_host
2013-12-13 10:05:14.095 TRACE cinder.service self.publish_service_capabilities(ctxt)
2013-12-13 10:05:14.095 TRACE cinder.service File "/opt/stack/cinder/cinder/volume/manager.py", line 912, in publish_service_capabilities
2013-12-13 10:05:14.095 TRACE cinder.service self._report_driver_status(context)
2013-12-13 10:05:14.095 TRACE cinder.service File "/opt/stack/cinder/cinder/volume/manager.py", line 904, in _report_driver_status
2013-12-13 10:05:14.095 TRACE cinder.service volume_stats = self.driver.get_volume_stats(refresh=True)
2013-12-13 10:05:14.095 TRACE cinder.service File "/opt/stack/cinder/cinder/volume/drivers/lvm.py", line 345, in get_volume_stats
2013-12-13 10:05:14.095 TRACE cinder.service self._update_volume_stats()
2013-12-13 10:05:14.095 TRACE cinder.service File "/opt/stack/cinder/cinder/volume/drivers/lvm.py", line 358, in _update_volume_stats
2013-12-13 10:05:14.095 TRACE cinder.service self.vg.update_volume_group_info()
2013-12-13 10:05:14.095 TRACE cinder.service File "/opt/stack/cinder/cinder/brick/local_dev/lvm.py", line 396, in update_volume_group_info
2013-12-13 10:05:14.095 TRACE cinder.service self.vg_thin_pool)
2013-12-13 10:05:14.095 TRACE cinder.service File "/opt/stack/cinder/cinder/brick/local_dev/lvm.py", line 149, in _get_thin_pool_free_space
2013-12-13 10:05:14.095 TRACE cinder.service consumed_space = float(data[0]) / 100 * (float(data[1]))
2013-12-13 10:05:14.095 TRACE cinder.service ValueError: empty string for float()
2013-12-13 10:05:14.095 TRACE cinder.service
2013-12-13 10:05:14.109 INFO cinder.service [-] Child 5052 exited with status 2
2013-12-13 10:05:14.110 INFO cinder.service [-] _wait_child 1
2013-12-13 10:05:14.110 INFO cinder.service [-] wait wrap.failed True

$ sudo lvchange -a n stack-volumes/stack-volumes-pool
$ sudo lvs -o size,data_percent --separator : stack-volumes/stack-volumes-pool
  LSize:Data%
  9.00g:

Eric Harney (eharney) on 2013-12-13
Changed in cinder:
assignee: nobody → Eric Harney (eharney)

Fix proposed to branch: master
Review: https://review.openstack.org/62018

Changed in cinder:
status: New → In Progress
Eric Harney (eharney) on 2013-12-13
description: updated
Changed in cinder:
importance: Undecided → Medium
milestone: none → icehouse-2

Reviewed: https://review.openstack.org/62018
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=6ccc654a0509c4e308713f9e6fd95266cd112c9d
Submitter: Jenkins
Branch: master

commit 6ccc654a0509c4e308713f9e6fd95266cd112c9d
Author: Eric Harney <email address hidden>
Date: Fri Dec 13 10:39:09 2013 -0500

    LVM: Activate Thin Pool LV upon initialization

    If the LVM thin pool is not active, space calculation fails,
    as data_percent is not known. Activate the pool upon initialization,
    since we intend to use it anyway.

    Slightly refactors _get_thin_pool_free_space so that it is clear
    which missing/unexpected value is breaking things if a similar error
    occurs for some other reason.

    Closes-Bug: #1260773

    Change-Id: I7cb187746c1ac297b82254c6efa37ba1c5fbb3e1

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2014-01-22
Changed in cinder:
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2014-04-17
Changed in cinder:
milestone: icehouse-2 → 2014.1

Reviewed: https://review.openstack.org/64848
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=0a70ba274a30e3a9b53a646049e1f185ba4e1c91
Submitter: Jenkins
Branch: stable/havana

commit 0a70ba274a30e3a9b53a646049e1f185ba4e1c91
Author: Eric Harney <email address hidden>
Date: Fri Dec 13 10:39:09 2013 -0500

    LVM: Activate Thin Pool LV upon initialization

    If the LVM thin pool is not active, space calculation fails,
    as data_percent is not known. Activate the pool upon initialization,
    since we intend to use it anyway.

    Slightly refactors _get_thin_pool_free_space so that it is clear
    which missing/unexpected value is breaking things if a similar error
    occurs for some other reason.

    Closes-Bug: #1260773

    Change-Id: I7cb187746c1ac297b82254c6efa37ba1c5fbb3e1
    (cherry picked from commit 6ccc654a0509c4e308713f9e6fd95266cd112c9d)

tags: added: in-stable-havana
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers