= Tear down the workshop resources
:icons:
:linkattrs:
:imagesdir: ../resources/images

*Congratulation!* You have completed the Amazon FSx for NetApp ONTAP  Workshop.


== Duration

NOTE: It will take approximately 10 minutes to complete this section.

=== Delete *Amazon FSx for ONTAP resources* 

IMPORTANT: Read through all steps below before continuing.

NOTE: It is *very important* that you delete the following resources prior to deleting the workshop environment via CloudFormation.

* Volumes on all file systems
* SVMs on all file systems

=== Delete FSx resources

. *_Return_* to the SSH connection of your *FSx for ONTAP Workshop Linux instance*

. *_Run_* the script below to unmount all the volumes
+
[source,bash]
----
sudo umount ${MOUNTPOINT}
sudo umount ${CLONEDIR}
----
+

. *_Run_* the below command to validate there are no volumes still mounted.
+
[source,bash]
----
mount | grep nfs
----
+

. *_Return_* to the SSH connection of your *FSx for ONTAP Workshop Linux instance* and SSH to the cluster management endpoint of your FSx for ONTAP file system.
+
[source,bash]
----
ssh ${ADMINUSER}@${MGMTENDPOINT}
----
+

. *_Run_* the below command to offline the FlexClone volume on your FSx for ONTAP file system.
+
[source,bash]
----
volume offline -volume vol1_clone1 -vserver svm01
----
+

. *_Run_* the below command to delete the FlexClone on your FSx for ONTAP file system.
+
[source,bash]
----
volume delete -volume vol1_clone1 -vserver svm01
----
+

. *_Run_* the below command to verify the FlexClone volume was successfully removed on your FSx for ONTAP file system.
+
[source,bash]
----
vol show
----
+

. Go to the link:https://console.aws.amazon.com/fsx/[Amazon FSx] console, *_Click_* the *File system ID* of your Amazon FSx for NetApp ONTAP file system. 

.  *_Examine_* the *Volumes* section on your file system. *_Click_* the *Volumes* tab. *_Select_* volume *vol1* -> *Actions* -> *Delete Volume*. *_Select_* *No* for create final backup, *_accept_* acknowledgment and *_Type_* *delete* in the Confirm delete section. *_Click_* *Delete volumes(s)* to delete the volume.


.  *_Examine_* the *Storage virtual machines* section on your file system. *_Click_* the *Storage virtual machines* tab. *_Select_* SVM *svm01* -> *Actions* -> *Delete storage virtual machine*. *_Click_* *Delete storage virtual machines* to delete the SVM.

. *_Verify_* the *volumes* and *Storage virtual machines* tabs to ensure there are no pending resources on your file system.


//. *_Click_* *Actions* on the top-right corner and *_select_* *Delete file system*. *_Type_* the *File system ID* and *_click_* *Delete file system*.



=== Delete *Workshop Environment* via CloudFormation

IMPORTANT: Read through all steps below before continuing.

. Open the link:https://console.aws.amazon.com/cloudformation/[Amazon CloudFormation] console.
+
TIP: *_Context-click (right-click)_* the link above and open the link in a new tab or window to make it easy to navigate between this GitHub workshop and AWS console.
+
. Make sure you are in the same *AWS Region* where you *_created_* your workshop environment.
. *_Click_* the *radio button* next to the *fsx-ontap-workshop* stack.
. *_Click_* the *Actions* button then *Delete stack*.
. *_Click_* *Yes, Delete* to delete the workshop environment.

IMPORTANT: It may take approximately 25 minutes to delete all AWS resources created by the CloudFormation template. Check the status periodically to verify all resources have been delete.


