21.3 Using Reflinks and Sparse Copying of vDisks in the SUSE Xen Provisioning Adapter

This section includes the following information:

21.3.1 Configuring Reflinks

OCFS2 in SUSE Linux High Availability (SLE HA) SP1 (and newer) supports reflinks (also referred to as refcounted links), providing significant performance advantages over a standard filesystem-level copy (cp) when you clone Xen VM images on SUSE Linux Enterprise Servers acting as VM Hosts. As a Cloud Manager Orchestration Server administrator, you might need control over whether the xen provisioning adapter should copy disk image files using reflinks or normal cp.

The Orchestration Server includes two Boolean facts that control the reflinks tuning for VMs and repositories. By default, these facts are marked true and accommodate the reflinks feature when it is available:

  • resource.vm.useReflinks

  • repository.useReflinks

If specified, the resource.vm.useReflinks fact takes precedence over the corresponding repository.useReflinks fact.

21.3.2 Sparse Copy

When reflinks are disabled or unavailable for use, the standard filesystem-level copy (cp) can optionally perform a sparse copy of Xen disks. A sparse copy operation designates unallocated blocks within the source vDisk file as not pre-allocated in the cloned copy. It is useful if you want to overcommit a disk for space efficiency or performance-related reasons. A non-sparse copy pre-allocates all disk blocks prior to usage.

By default, the decision to perform either a sparse or a normal copy is left to the cp(1) command, which uses a “crude heuristic” to determine whether the source file is sparse. However this heuristic can be overridden per-VM using the resource.vm.sparseCopy fact, or per-repository, using the repository.sparseCopy fact. If you decide to set either of these String facts, they must have one of the following values, as documented in the cp(1) man page:

  • auto (For example, --sparse=auto. Use this value to have the crude heuristic detect sparse SOURCE files and make the corresponding DEST file. This is the default value for sparse copy.)

  • always (For example, --sparse=always. Use this value to create a sparse DEST file whenever the SOURCE file contains a long enough sequence of zero bytes.)

  • never (For example, --sparse=never. Use this value to inhibit creation of sparse files.)