APIs in Category: clone | 7-Mode API version 1.21

clone-clear clone-list-status clone-start clone-stop | The cloning feature is based on constant time sis cloning storage (SIS) implementation and is the the block sharing infrastructure provided by Data ONTAP. The feature allows for the cloning from either a file or a LUN. Also the user can clone the entire file or LUN (full range) or a portion of the file or LUN (sub range). In case of full range cloning, a new file/LUN will always be created in the same volume where the source file/LUN exists. In case of sub range cloning, the destination file can either be same as the source file/LUN or can be a different file/LUN within the same volume where the source file/LUN exists. Constant time SIS cloning supersedes the implementation of cloning in versions older than Data ONTAP 8.1. In Data ONTAP 8.0 the cloning implementation is an asynchronous operation. The clone-start API is used to start a clone operation. It returns an clone-id which is used for polling to get the status of the clone operation using the clone-list-status API. If this API returns success, the user can consider that clone operation has completed; if it returns failure, the user should clear the status of clone operation using clone-clear API. A clone operation in progress can be aborted using the clone-stop API. In Data ONTAP 8.1 the cloning implementation is a synchronous operation. The APIs to manage ongoing synchronous operations are deprecated, but retained for backwards compatibility.

NetApp Manage ONTAP

clone-clear | [top]

> Clears information of a failed clone operation. If not successful, the error code will be returned as API error. This API is deprecated in Data ONTAP 8.1 and later, and will always fail with EDENSE_CLONE_NOT_RUNNING.

> Input Name | Range | Type | Description
> clone-id |  | clone-id-info | ID information of the clone operation.

> Vfiler-enabled
> Yes

clone-list-status | [top]

> Gets the information of a clone operations identified by clone-id. If clone-id is not specified, then it will get the status of all running and failed clone operation on the filer. It will get the status as 'running', 'failed' or 'completed'. User may see some other transient status for the clone operation, but any other status should be considered for polling clone-list-status again. User should keep polling clone-list-status till status returned is 'failed' or 'completed'. If status is 'completed', the clone operation has been completed successfully. If status is 'failed', then user is responsible for doing clone-clear to clean the status of the clone information. When a clone operation is aborted using clone-stop, it may take some time to stop the clone operation. User should poll clone-list-status till status returned is 'completed'. When status returned is 'completed' after clone-stop, the clone operation has been stopped successfully. This API is deprecated in Data ONTAP 8.1 and later. If a clone-id from a previous successful call to clone-start is provided, the operation will always be in the "completed" state.

> Input Name | Range | Type | Description
> clone-id |  | clone-id-info optional | ID information of the clone operation. If not specified, it will get the status of all running and failed clone operations on the filer.
> Output Name | Range | Type | Description
> status |  | ops-info[] optional | List of information of running and failed clone operations on the filer.

> Vfiler-enabled
> Yes

clone-start | [top]

> In Data ONTAP 8.0 and earlier this API starts a file/LUN or sub-file/sub-LUN clone operation asynchronously. If clone operation starts successfully, a unique clone-id is returned. User is supposed to poll clone-list-status specifying clone-id to get the status of the clone operation. When clone-list-status returns status as completed, user can consider that the clone operation has been completed successfully. If user gets status as failed, user is responsible for doing clone-clear which will clean the status of the clone operation. In Data ONTAP 8.1 and later, this API performs a file/LUN or sub-file/sub-LUN clone operation synchronously. When this API returns successfully, the destination file is ready for use.

> Input Name | Range | Type | Description
> block-ranges |  | block-range[] optional | List of block ranges for sub-file/sub-LUN cloning. The number of block ranges is limited to 32. For sub-LUN cloning the block range specified will be considered as SCSI LBA range. If only one block range is supplied, the source and destination range must not overlap and both ranges must not extend past the end of the file If multiple block ranges are specified in one operation, the user must ensure all source and destination ranges do not overlap, otherwise the result is undefined. In case of sub-LUN cloning, the API will copy data in case the LBAs are not block aligned. If the user provides LBAs such that actual number of blocks to be cloned is zero, then API will return error. The API will fail if the source range overlaps with the destination range or if the source and the destination ranges overlap amongst themselves. If block range is not provided then the file/LUN cloning is fully cloned.
> change-log |  | boolean optional | If this option is "true", fingerprints of data blocks of the destination file/block ranges created will be change logged to the change log file if A-SIS is enabled on the volume. With change logging clone operation will be slow, as to get fingerprints all the data blocks will be read. Without change logging clone operation deals with only indirect blocks without reading data blocks. Without change logging, fingerprints of the clone blocks are not recorded. The clone blocks are shared with the source blocks, but as later the source blocks are modified, corresponding clone blocks will no longer be shared. If change logging option is not used, clone blocks, which could be involved in sharing with rest of the file system, can not be shared in next sis operation. The only option, in case user had not used change logging while creating clone, will be to start sis from beginning using "sis start -s" to gather fingerprints of clone blocks. In Data ONTAP 8.1 and later, this field is accepted for backwards compatibility and is ignored.
> destination-path |  | string optional | Full path of the Destination file or LUN in //file-path format. Destination path should be in same flexible volume as "source-path". If not specified, a sub-range clone of the source file or LUN will be performed onto itself. Either "destination-path" or "block-ranges" must be specified.
> ignore-locks |  | boolean optional | Clone even if (advisory/mandatory) byte_range locks or share_mode locks exist on the source or destination. By default value is false.
> ignore-streams |  | boolean optional | Clone only the base file and ignore streams on source or destination. By default value is false so streams are also cloned from source and existing destination streams are deleted.
> no-snap |  | boolean optional | If no-snap is FALSE or unspecified, then a temporary snapshot will be taken and source file locked in snapshot will be considered for cloning. So that the clone operation does not get affected by writes to the source file in parallel to the clone operation. User will get atomic point in time copy of the source. Irrespective of clone operation completes successfully or unsuccessfully, any temporary snapshot taken for cloning will be deleted automatically. If no-snap is "true", then the source file in AFS will be used for cloning. In this case user may get random data in clone if source file is modified while clone operation is in progress. This option should only be used when user is assured that the source file will remain consistent during the clone operation. Destination file is not protected against any modification while clone operation is in progress. User should use the destination file or destination block ranges after clone operation is finished. In Data ONTAP 8.1 and later, this field is accepted for backwards compatibility and is ignored.
> snapshot-name |  | string optional | Snapshot name from which to clone the source file or LUN. If not specified, the contents of in the active filesystem will be used. This field is available in Data ONTAP 8.1 or later
> source-path |  | string | Full path of the source file or LUN in //file-path format.
> space-reserve |  | boolean optional | Set the space reservation of the destination clone. By default space reservation is inherited from source. The API errors out if used in conjunction with block range arguments, since space reservations cannot be set for a block range.
> Output Name | Range | Type | Description
> clone-id |  | clone-id-info | Unique ID information for the clone operation returned if clone operation starts successfully. This field is deprecated in Data ONTAP 8.1 and later, the returned value is guaranteed to be a completed clone operation if supplied to clone-list-info.

> Errno | Description
> ESIS_CLONE_CLONE_INVALID_SPC_RSRV |  |
> ESIS_CLONE_NLCSR_INPROG |  |
> ESIS_CLONE_VOL_NONEXIST |  |
> ESIS_CLONE_VOL_OFFLINE |  |
> ESIS_CLONE_VOL_NOTSUP |  |
> ESIS_CLONE_VOL_RDONLY |  |
> ESIS_CLONE_VOL_TRANSITING |  |
> ESIS_CLONE_STALE_INODE |  |
> ESIS_CLONE_STALE_DINODE |  |
> ESIS_CLONE_STALE_RINODE |  |
> ESIS_CLONE_SHUTDOWN |  |
> ESIS_CLONE_FAILOVER |  |
> ESIS_CLONE_CLONE_EXIST |  |
> ESIS_CLONE_CLONE_SFILE_NONEXIST |  |
> ESIS_CLONE_CLONE_CFILE_NONEXIST |  |
> ESIS_CLONE_CLONE_DIFF_VOLUME |  |
> ESIS_CLONE_CLONE_SFILE_ATTR |  |
> ESIS_CLONE_CLONE_CFILE_ATTR |  |
> ESIS_CLONE_CLONE_FH |  |
> ESIS_CLONE_CLONE_SOURCE_FH |  |
> ESIS_CLONE_CLONE_TYPE_SUPP |  |
> ESIS_CLONE_CLONE_OVERLAP_RANGE |  |
> ESIS_CLONE_CLONE_INVALID_RANGE |  |
> ESIS_CLONE_CLONE_INVALID_SOURCE |  |
> ESIS_CLONE_CLONE_INVALID_CLONE |  |
> ESIS_CLONE_CLONE_INVALID_DIR |  |
> ESIS_CLONE_CLONE_WORM_VOL |  |
> ESIS_CLONE_VDISK_INVALID_NAME |  |
> ESIS_CLONE_LICENSE_EXPIRED |  |
> ESIS_CLONE_NOT_LICENSED |  |
> ESIS_CLONE_LICENSE_EXPIRED |  |
> ESIS_CLONE_NOT_LICENSED |  |
> ESIS_CLONE_DECOMP_ACTIVE |  |
> ESIS_CLONE_SPLIT_MAP |  |
> ESIS_CLONE_SOURCE_TOO_SMALL |  |
> EONTAPI_EBUSY |  |
> EONTAPI_ESTALE |  |
> EONTAPI_EDQUOT |  |
> EONTAPI_EACCES |  |
> EONTAPI_ENOSPC |  |
> ESIS_CLONE_DOWNGRADE |  |
> ESIS_CLONE_VFILER_ACCESS |  |
> ESIS_CLONE_MAX_RANGES |  |
> ESIS_CLONE_MAX_BLKS |  |
> EINTERNALERROR |  |
> ESIS_CLONE_MAX_DENSE_LIMIT_REACHED |  |

> Vfiler-enabled
> Yes

clone-stop | [top]

> Stops a running clone operation. If not successful, the error code will be returned as API error. This API is deprecated in Data ONTAP 8.1 and later, and will always fail with EDENSE_CLONE_NOT_RUNNING.

> Input Name | Range | Type | Description
> clone-id |  | clone-id-info | ID information of the clone operation.

> Vfiler-enabled
> Yes

Element definition: block-range | [top]

> Structure containing source and destination block range for sub-file/sub-LUN cloning.

> Name | Range | Type | Description
> block-count | [1..2^24] | integer | Number of blocks to be cloned.
> destination-block-number | [0..2^63-1] | integer | Starting file block number of destination block range.
> source-block-number | [0..2^63-1] | integer | Starting file block number of source block range. Block size is 4096 bytes.

Element definition: clone-id-info | [top]

> Structure containing clone ID information.

> Name | Range | Type | Description
> clone-op-id | [0..2^63-1] | integer | ID of the clone operation.
> volume-uuid |  | string | uuid of the volume.

Element definition: ops-info | [top]

> Structure containing information of a clone operation.

> Name | Range | Type | Description
> block-ranges |  | block-range[] optional | List of block ranges specified for sub-file/sub-LUN cloning. In case of complete file cloning there will be no output corresponding to this.
> blocks-copied | [0..2^63-1] | integer optional | Number of blocks that have been copied so far for running clone operation. The cloning operation shares destination blocks with source block. But if source block has already reached maximum number of sharing supported by WAFL, then block is copied for destination. It is recommended that if blocks are being copied, then user should change the source for next clone operation.
> clone-id |  | clone-id-info optional | Unique ID information of the clone operation.
> clone-state |  | string | State of the clone operation. It could be 'running', 'failed' or 'completed'. For 'completed' state there will be no other field in ops-info output.
> clone-type |  | string optional | Type of clone. Possible types are 'file', 'sub_file', 'lun' and 'sub_lun'.
> destination-file |  | string optional | Destination file path. For sub-file/sub-LUN cloning within the same file/LUN, source-file and destination file will be same.
> error |  | integer optional | Error code corresponding to reason of failure. If error code is EDENSE_SHUTDOWN or EDENSE_FAILOVER, the clone operation will be restarted automatically after giveback/takeover or next reboot. If user has not aborted the clone operation using clone-stop, then for any other error code user should do clone-clear.
> percent-done | [0..100] | integer optional | Percentage cloning completed for running clone operation.
> reason |  | string optional | Reason of failure if clone operation could not complete successfully.
> source-file |  | string optional | Source file path.
> total-blocks | [0..2^63-1] | integer optional | Total number of blocks to be cloned for running clone operation.

Element definition: block-range | [top]

> Structure containing source and destination block range for sub-file/sub-LUN cloning.

> Name | Range | Type | Description
> block-count | [1..2^24] | integer | Number of blocks to be cloned.
> destination-block-number | [0..2^63-1] | integer | Starting file block number of destination block range.
> source-block-number | [0..2^63-1] | integer | Starting file block number of source block range. Block size is 4096 bytes.

Element definition: clone-id-info | [top]

> Structure containing clone ID information.

> Name | Range | Type | Description
> clone-op-id | [0..2^63-1] | integer | ID of the clone operation.
> volume-uuid |  | string | uuid of the volume.