Create a FlexClone file or FlexClone LUN in ONTAP
You can create space-efficient and time-efficient clones of files and LUNs present in FlexVol volumes or FlexClone volumes by using the volume file clone create
command.
-
The FlexClone license must be installed on the cluster. This license is included with ONTAP One.
-
If multiple block ranges are used for sub-LUN cloning or sub-file cloning, the block numbers must not overlap.
-
If you are creating a sub-LUN or sub-file on volumes with adaptive compression enabled, the block ranges must not be misaligned.
This means that the source start block number and destination start block number must either be even aligned or odd aligned.
Depending on the privileges assigned by the cluster administrator, an SVM administrator can create FlexClone files and FlexClone LUNs.
You can specify the autodelete setting for FlexClone files and FlexClone LUNs when you create and modify clones. By default, the autodelete setting is disabled.
You can overwrite an existing FlexClone file or FlexClone LUN when you create a clone by using the volume file clone create
command with the -overwrite-destination
parameter.
When the node reaches its maximum split load, the node temporarily stops accepting requests to create FlexClone files and FlexClone LUNs and issues an EBUSY
error message. When the split load for the node falls below the maximum, the node accepts requests to create FlexClone files and FlexClone LUNs again. You should wait until the node has capacity to create the clones before trying the create request again.
The FlexClone LUN inherits the space reservations attribute of the parent LUN. A space-reserved FlexClone LUN requires as much space as the space-reserved parent LUN. If the FlexClone LUN is not space-reserved, the volume must have enough space to accommodate changes to the clone.
-
If you are cloning a LUN, verify that the LUN is not mapped or being written to.
-
Create the FlexClone LUN or file:
volume file clone create -vserver vserver_name -volume volume_name -source-path source_path -destination-path destination_path
The following example shows how you can create a FlexClone file file1_clone of the parent file file1_source in the volume vol1:
cluster1::> volume file clone create -vserver vs0 -volume vol1 -source-path /file1_source -destination-path /file1_clone
Learn more about
volume file clone create
in the ONTAP command reference.
Create FlexClone LUNs from a snapshot in a volume
You can use a snapshot in your volume to create FlexClone copies of your LUNs. FlexClone copies of LUNs are both readable and writeable.
A FlexClone license must be installed. This license is included with ONTAP One.
The FlexClone LUN inherits the space reservations attribute of the parent LUN. A space-reserved FlexClone LUN requires as much space as the space-reserved parent LUN. If the FlexClone LUN is not space-reserved, the volume must have enough space to accommodate changes to the clone.
-
Verify that the LUN is not mapped or being written to.
-
Create a snapshot of the volume that contains the LUNs:
volume snapshot create -vserver vserver_name -volume volume_name -snapshot snapshot_name
You must create a snapshot (the backing snapshot) of the LUN you want to clone.
-
Create the FlexClone LUN from the snapshot:
volume file clone create -vserver vserver_name -volume volume_name -source-path source_path -snapshot-name snapshot_name -destination-path destination_path
If you need the FlexClone LUN to be available for automatic deletion, you include
-autodelete true
. If you are creating this FlexClone LUN in a volume using semi-thick provisioning, you must enable automatic deletion for all FlexClone LUNs. -
Verify that the FlexClone LUN is correct:
lun show -vserver vserver_name
Vserver Path State Mapped Type Size ------- ---------------------- -------- --------- -------- ------- vs1 /vol/vol1/lun1_clone online unmapped windows 47.07MB vs1 /vol/vol1/lun1_snap_clone online unmapped windows 47.07MB