LVM: thin volume created from a thin snapshot is no longer thin

Bug #1472486 reported by Vincent Hou
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
High
Mitsuhiro Tanino

Bug Description

This applies to the LVM driver. I am not sure what the situation will be for other drivers.

First, create a thin volume vol1. Then try to attach it and write something into it, making sure that the usage increases a bit, like 10%.
Then, create a snapshot of this thin volume, named snap.
Third, create a second thin volume vol2 from the snapshot(named snap) created in Step 2.

In the end, the volume vol2 will end up with a usage of 100%, not the 10% as the original.

Tags: drivers lvm
Vincent Hou (houshengbo)
tags: added: lvm
Revision history for this message
Eric Harney (eharney) wrote :

Is bug 1224671 related?

Revision history for this message
Mitsuhiro Tanino (mitsuhiro-tanino) wrote :

@Eric, correct.

I fixed create_cloned_volume() path by above patch, but I missed to fix create_volume_from_snapshot() path.
I will post a fix quickly for create_volume_from_snapshot() path too.

@VIncent,
Thank you for catching this.

Changed in cinder:
assignee: nobody → Mitsuhiro Tanino (mitsuhiro-tanino)
Jay Bryant (jsbryant)
tags: added: drivers
Changed in cinder:
importance: Undecided → High
status: New → Confirmed
milestone: none → liberty-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

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

Changed in cinder:
status: Confirmed → In Progress
Mike Perez (thingee)
Changed in cinder:
milestone: liberty-2 → liberty-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/200237
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=8a944bc8573eee775de8ea983191e0a4e808aaba
Submitter: Jenkins
Branch: master

commit 8a944bc8573eee775de8ea983191e0a4e808aaba
Author: Mitsuhiro Tanino <email address hidden>
Date: Thu Jul 9 16:04:25 2015 -0400

    LVM: Support efficient data copy for LVM driver

    The create_volume_from_snapshot() and migrate_volume() use
    dd command for data copy, but the copy always copies full blocks
    even if the source data contains many null or zero blocks.
    When we use thin provisioned LVM, blocks are not pre-allocated,
    so unused region returns zero.
    If we copy full block for destination volume, unnecessary blocks
    will be allocated and the usage will be 100%.

    The dd command has conv=sparse option in order to copy data more
    efficiently. This patch enables conv=sparse option for
    create_volume_from_snapshot() and migrate_volume() when we use
    thin provisioned LVM.

    Change-Id: I104c4127bc4a33da9c11ad2aac93766f862e2981
    Closes-bug: #1472486

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in cinder:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: liberty-3 → 7.0.0
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.