3.3.4 Clone Files

An Exascale clone is a thinly-provisioned point-in-time copy of a file that is readable and writable. The source file for a clone can be a regular file, a snapshot, or another clone. Exascale uses redirect-on-write techniques to create and maintain clones very quickly and space-efficiently.

To clone a file or group of files, use the ESCLI clonefile command.

All clones created in the same operation are point-in-time consistent, and all files in a clone operation must be in the same vault.

  • To clone a single file, use the clonefile command and specify the source file and the clone destination. For example:
    @> clonefile @myvaultname/myfilename @myvaultname/myclonefile

    In the previous example, the clone (@myvaultname/myclonefile) is created in the same location as the original file (@myvaultname/myfilename). In the following example, the clone is created under @myvaultname/clones.

    @> clonefile @myvaultname/myfilename @myvaultname/clones/myotherclonefile
  • To clone a group of files, use the clonefile command and specify the source files and the clone destinations by including the wildcard character (*). For example:
    @> clonefile @myvaultname/myfiles* @myvaultname/myclonefiles*

    In the previous example, the clones are created in the same location as the original files. In the following example, the clones are created in a different location.

    @> clonefile @myvaultname/myfiles* @myvaultname/moreclones/moreclonefiles*
  • To clone multiple files or groups of files, use the clonefile command and specify multiple source and destination pairs. For example:
    @> clonefile @myvaultname/file1 @myvaultname/file1clone @myvaultname/myfiles* @myvaultname/myclonefiles*

    In the previous example, an individual file (@myvaultname/file1) and a group of files (@myvaultname/myfiles*) are cloned in the same operation, and the clones (@myvaultname/file1clone and @myvaultname/myclonefiles*) are created in the same location as the original files.

    In the following example, the clones are created in multiple different locations.

    @> clonefile @myvaultname/file1 @myvaultname/location1/file1clone @myvaultname/myfiles* @myvaultname/location2/myclonefiles*

    When you specify multiple source and destination pairs, the source file specifications are considered in order, and only the first match is used.

    For example, the following command creates clones under @myvaultname/clone/a for files matching @myvaultname/a*, while the clones for the other files are created under @myvaultname/clone/other.

    @> clonefile @myvaultname/a* @myvaultname/clone/a/a* @myvaultname/* @myvaultname/clone/other/*

    However, the following command creates all of the clones under @myvaultname/clone/other because all of the files match @myvaultname/*. So, in this case, the second argument pair is never used.

    @> clonefile @myvaultname/* @myvaultname/clone/other/* @myvaultname/a* @myvaultname/clone/a/a*
  • To clone some files while excluding others, use the clonefile command with one of the following exclusion methods:
    • You can use the --exclude option to specify files that are excluded from the clone operation.

      For example, the following command clones files in @myvaultname, except for files matching @myvaultname/a* or @myvaultname/b*:

      @> clonefile @myvaultname/* @myvaultname/clone/* --exclude @myvaultname/a* --exclude @myvaultname/b*
    • If you specify a null (empty) string as a clone destination value, no clones are created for the corresponding source files. The null destination and corresponding source is considered in order along with all other source and destination pairs, and only the first match is used.

      For example, the following command also clones files in @myvaultname, except for those matching @myvaultname/a* or @myvaultname/b*.

      @> clonefile @myvaultname/a* "" @myvaultname/b* "" @myvaultname/* @myvaultname/clone/*
After creation, clones are managed using the same commands and procedures that are used for other files. For example, you must use the rmfile command to delete a clone.

Related Topics