A clone VDisk is an identical copy of another VDisk.
The clone VDisk has the following properties:
- A clone VDisk contains the same data as the source VDisk.
- A clone VDisk does not require additional space on disk. (A small amount of space is however required for metadata and sometimes even data)
- Once created, a clone is independent of the VDisk from which it was created. This means that changes to the source VDisk after the creation of the clone will not be reflected in the clone. Likewise changes in the clone is not reflected in the source disk
- The time taken for a clone operation to complete depends on the size and the amount of data stored in a VDisk. However once a clone operation has started changes to the source VDisk is permitted. Changes made to the source VDisk after the clone operation has started (even if the clone operation is still in progress) will not be reflected in the clone. This behaviour is similar to that of snapshots. A Clone is not accessible to clients till the clone operation has completed
Creating a clone
To create a clone, login to the QUADStor system and run the command
/quadstor/bin/qclone -s <Source VDisk Name> -d <Clone VDisk Name>
The Clone VDisk Name cannot not be the name of an existing VDisk. The clone is created with the same properties of the source disk, such as 512 byte emulation etc.
For example if the source VDisk name is 'FOO and the clone VDisk name is 'BAR', the command to create the clone is
# /quadstor/bin/qclone -s FOO -d BAR
Clone of FOO to BAR successfully started
Listing clone operations
#/quadstor/bin/qclone -l
Source Destination Progress
FOO BAR 35%
Unlike when creating a new VDisk, a clone however isn't immediately accessible by the clients via iSCSI, FC etc. when the clone operation is still in progress
# /quadstor/bin/qclone -l
Source Destination Progress
FOO BAR Completed
Once a clone operation is completed, the VDisk is accessible over the local, iSCSI and FC interfaces
If an option -p is passed the clone operations are listed, but completed/error operations are then cleared. For example
# /quadstor/bin/qclone -l -p
Source Destination Progress
FOO BAR Completed
Since the above operation has completed, it is now cleared
# /quadstor/bin/qclone -l
Source Destination Progress
Canceling a clone operation
To cancel a clone operation while its in progress run the command
/quadstor/bin/qclone -s <Source VDisk Name> -c
For our example the command would be
# /quadstor/bin/qclone -s FOO -c
Notes
If the source VDisk is use by a client, the client might mark the source VDisk as active. For example if a file system on the source VDisk is mounted, the filesystem is marked as dirty. When the source VDisk is cloned, this state is also copied to the clone. Now when the filesytem on the clone is to be mounted the system might complain that the filesystem is dirty