Bug 631909

Summary: RFE: storage clone: Use equivalent of cp --reflink=auto, gives us btrfs CoW
Product: [Community] Virtualization Tools Reporter: Josef Bacik <jbacik>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: low    
Version: unspecifiedCC: berrange, clalancette, crobinso, dougsland, hbrock, itamar, jforbes, jtomko, laine, libvirt-maint, rbalakri, veillard, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-16 15:45:05 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Josef Bacik 2010-09-08 16:16:53 UTC
Instead of copying the entire backing storage when doing a clone of a guest, use cp --reflink=auto.  This will allow us to use BTRFS's CoW functionality to quickly clone the storage, and will fall back to the standard boring copy if the filesystem doesn't support it.  That way I don't have to wait 20 minutes while my guests storage is copied :).

Comment 1 Cole Robinson 2012-01-18 15:47:22 UTC
This is really a libvirt request.

Comment 2 Cole Robinson 2012-06-07 13:46:27 UTC
Moving to upstream tracker

Comment 3 Ján Tomko 2015-03-16 15:45:05 UTC
The support for a reflink copy is now upstream. It has to be explicitly requested and there is no fallback.

commit 219ea41d8dbad32137b4376ecb17fa958d5751b8
Author:     Chen Hanxiao <chenhanxiao.com>
AuthorDate: 2015-02-03 11:05:27 +0800
Commit:     John Ferlan <jferlan>
CommitDate: 2015-02-03 11:37:30 -0500

    virsh-volume: add support for --reflink
    
    Add support for --reflink to the virsh 'vol-create-from' and 'vol-clone'
    commands to signify usage of the VIR_STORAGE_VOL_CREATE_REFLINK flag in the
    ensuing virStorageVolCreateXMLFrom API call.
    
    Updated the man page to describe the new flag.
    
    Signed-off-by: Chen Hanxiao <chenhanxiao.com>

git describe: v1.2.12-70-g219ea41 contains: v1.2.13-rc1~129

commit 95da191376c4893ad3da1a7b37594f679fab9e03
Author:     Chen Hanxiao <chenhanxiao.com>
AuthorDate: 2015-01-23 18:22:35 +0800
Commit:     Ján Tomko <jtomko>
CommitDate: 2015-01-27 13:41:14 +0100

    storage: add a flag to clone files on btrfs
    
    When creating a RAW file, we don't take advantage
    of clone of btrfs.
    
    Add a VIR_STORAGE_VOL_CREATE_REFLINK flag to request
    a reflink copy.
    
    Signed-off-by: Chen Hanxiao <chenhanxiao.com>
    Signed-off-by: Ján Tomko <jtomko>

git describe: v1.2.12-18-g95da191 contains: v1.2.13-rc1~181