= Clones :toc: :icons: :linkattrs: :imagesdir: ../resources/images == Summary This section will cover Clone feature available with *Amazon FSx for OpenZFS* file system. === Clones Overview A clone volume in Amazon FSx for OpenZFS is a writable copy that is initialized with the same data as the snapshot from which it was created. Clone volumes provide an easy way to support multiple users or applications in parallel from a shared dataset, as well as quickly test changes to your databases or applications. Common use cases include development or test environments where you want to create a copy of your production data and use it for testing. For example, you may want to take a clone of your database and test changes before applying them in production. With Clones, you do not need to copy the data to another volume. Clone volumes are created almost instantly and initially consume no additional storage capacity. They only consume capacity for incremental changes to the source snapshot. == Duration NOTE: It will take approximately 7 minutes to complete this section. == Step-by-step Guide (Clones) === Clone steps . *Return* to the browser tab for your *Amazon FSx for OpenZFS* file system and *Volumes* section of your file system. If you closed the browser tab return to the link:https://console.aws.amazon.com/fsx/[Amazon FSx] console, *_Click_* the *File system ID* of your Amazon FSx for OpenZFS file system and then *Volumes* section of your file system. . *_Right-Click_* on the volume name *clone_vol* and *_select_* *Open Link in New Tab* to *_Examine_* the volume properties in a new browser tab. Go to the new browser tab and *_Find_* the values of the following volume attributes: ** Source snapshot. *_Right-Click_* on the *Source snapshot* ARN and *_select_* *Open Link in New Window* to *_Examine_* the *Name* of the snapshot that was used to create the clone volume. + TIP: This is the same snapshot *openzfs_workshop_volume_snapshot* we used in the *Data Protection* section of this workshop. The clone volume was created by the workshop environment using this snapshot. You can create instant point in time clones using a snapshot of your source volumes using FSx Console, API or AWS CLI. To create a new clone you will create a new volume and under *Create clone from source snapshot*, you will select the snapshot that will be used to create the clone. . *_Close_* this browser window and *_Return_* to the SSH connection of the *FSx for OpenZFS Workshop Linux Instance*. . *_Run_* below command to create mount point for the clone volume. + [source,bash] ---- sudo mkdir /clone ---- + . *_Return_* to the browser tab for your Amazon FSx for OpenZFS file system, *_Select_* the clone volume with name *clone_vol* and *_Click_* *Attach*. On the *Attach file system* window, under *From Linux instances*, copy the *mount* command listed under *_Attach instruction - using the default DNS name_*. . *_Return_* to the SSH connection of the *FSx for OpenZFS Workshop Linux Instance*. *_Run_* mount command you copied in previous step. Replace the local_path with mount point */clone* created earlier. + TIP: If the SSH connection has timed out, e.g. the session is unresponsive, close the SSH connection window and create a new one. + [source,bash] ---- sudo mount -t nfs -o nfsvers=4.1 <DNSNAME>:/fsx/clone_vol/ /clone ---- + [source,bash] ---- Example: sudo mount -t nfs -o nfsvers=4.1 fs-01234515abdcefgh.fsx.us-east-1.amazonaws.com:/fsx/clone_vol/ /clone ---- + . *_Run_* below command to confirm your file system was successfully mounted. + [source,bash] ---- mount | grep -i nfs ---- + . *_Run_* below command to examine the size and available space for source and clone volume. + [source,bash] ---- df -h /fsxsync /clone ---- + . *_Run_* below commands to compare the contents of the file *demofile01.txt* in the source snapshot from which the clone was created and the clone volume. + [source,bash] ---- cat /fsxsync/.zfs/snapshot/openzfs_workshop_volume_snapshot/demofile01.txt /clone/demofile01.txt ---- + TIP: You should see identical contents and space usage reported for both volumes. . *_Run_* the below command to create a new file on the Clone volume. + [source,bash] ---- echo "Amazon FSx for OpenZFS workshop - New file on Cloned Volume" >> /clone/clone.txt ---- + . *_Run_* the below command to create a new 128MB file on the Clone volume. + [source,bash] ---- jobName=$(echo $(uuidgen) | grep -o ".\{6\}$") count=1 threads=1 blockSize=16M blockCount=8 seq 1 ${count} | parallel --will-cite -j ${threads} time dd if=/dev/zero of=/clone/dd-${jobName}-{} bs=${blockSize} count=${blockCount} ---- + . *_Run_* below commands to compare the contents of of your source and clone volume. + [source,bash] ---- ls -lt /fsxsync /clone df -h /fsxsync /clone ---- + . Are the contents and space used still identical? == Next section Click the button below to go to the next section. image::test-performance.jpg[link=../06-test-performance/, align="left",width=420]