Thursday, August 22, 2013

Netapp Bulk Qtree Creation Script

Creating qtree’s in bulk is something that has to be done rarely, but when it does, it’s easier to do it with a script rather than one command at a time. I’ve only had to do this twice in my Netapp career, but they were a life saver. Below is a simplified view of the process.
Create a file with any name you want. I  called it bulk-qtrees . It should have the command structure that would be used to create qtree’s from the command line on the filer. Mine looks like:
qtree create /vol/vol1/tomcat-6.1-BOMG
qtree create /vol/vol1/tomcat-6.1-BOME
qtree create /vol/vol1/tomcat-6.1-BOME3
qtree create /vol/vol1/tomcat-6.1-BOMU
qtree create /vol/vol1/tomcat-6.1-BOM8
qtree create /vol/vol1/WAR-Files-DEBUG1
qtree create /vol/vol1/WAR-Files-DEBUG-dev
qtree create /vol/vol1/WAR-Files-DEBUG-staging
qtree create /vol/vol1/WAR-Files-DEBUG-prod
qtree create /vol/vol1/science-data-test
qtree create /vol/vol1/science-data-ab
qtree create /vol/vol1/science-data-trusted
qtree create /vol/vol1/science-data-imported-south
qtree create /vol/vol1/science-data-imported-south-w
qtree create /vol/vol1/science-data-imported-south-e
qtree create /vol/vol1/science-data-imported-south-central
qtree create /vol/vol1/science-data-export-prod
qtree create /vol/vol1/science-data-export-prod-sync
qtree create /vol/vol1/science-data-export-prod-out
qtree create /vol/vol1/science-data-export-prod-dup
qtree create /vol/vol1/web-int-dev
qtree create /vol/vol1/web-int-stage
qtree create /vol/vol1/web-int-prod
qtree create /vol/vol1/web-ext-dev
qtree create /vol/vol1/web-ext-stage
qtree create /vol/vol1/web-ext-prod
qtree create /vol/vol1/web-val-dev
qtree create /vol/vol1/web-val-stage
qtree create /vol/vol1/web-val-prod

Process the Qtree Creation Script

place file you just created above on /vol/vol0 which should be mounted with root permission on some system. ssh into the filer are run the following command from command line:
> source /vol/vol0/bulk-qtrees
Your qtree’s are now created.

No comments:

Post a Comment