Home > General > SMS with NetApp FlexClone

SMS with NetApp FlexClone

February 3rd, 2009

I was working with a customer that was just about to deploy a group of new SMS servers for application deployment in their domain. They have about 150GB worth of applications, this all needs to go on their filer, needs to get snapshotted, and also needs 5 SMS deployment servers (each needing the same applications). That adds up to around about 1TB of storage (including the defaults for Fractional Reservation and Snap Reserve).

This won’t do for me and is a lot of wasted storage! The idea is that we have 1 “master” SMS deployment server, in reality they are all equal, but we use the first in the list as the “master”, as such. Each machine will get any new applications deployed to it each day, but in the night (run it daily) the storage is blown away and the master gets it’s applications volume cloned and shared out again.

All in, with various storage tweaks, I think the customer ended up using about 200GB!

The following is a batch file that would be run daily on the master SMS server. The applications volume is drive E:, and the volume on the filer is called “vm000_smsdp_master”.

@echo off
REM —— begin

echo * Disable SMS Share and stop SMS service *
net stop CcmExec
net share SMSPKGE$ /delete

echo * Disable NetApp CIFS shares for SnapDrive *
“c:\Scripts\plink.exe” root@filer -i “c:\Scripts\id_rsa.ppk” cifs shares -delete vm001_smsdp_vm$
“c:\Scripts\plink.exe” root@filer -i “c:\Scripts\id_rsa.ppk” cifs shares -delete vm002_smsdp_vm$
“c:\Scripts\plink.exe” root@filer -i “c:\Scripts\id_rsa.ppk” cifs shares -delete vm003_smsdp_vm$
“c:\Scripts\plink.exe” root@filer -i “c:\Scripts\id_rsa.ppk” cifs shares -delete vm004_smsdp_vm$

echo * Offline NetApp cloned volumes *
“c:\Scripts\plink.exe” root@filer -i “c:\Scripts\id_rsa.ppk” vol offline vm001_smsdp_vm
“c:\Scripts\plink.exe” root@filer -i “c:\Scripts\id_rsa.ppk” vol offline vm002_smsdp_vm
“c:\Scripts\plink.exe” root@filer -i “c:\Scripts\id_rsa.ppk” vol offline vm003_smsdp_vm
“c:\Scripts\plink.exe” root@filer -i “c:\Scripts\id_rsa.ppk” vol offline vm004_smsdp_vm

echo * Destroy NetApp cloned volumes *
“c:\Scripts\plink.exe” root@filer -i “c:\Scripts\id_rsa.ppk” vol destroy vm001_smsdp_vm -f
“c:\Scripts\plink.exe” root@filer -i “c:\Scripts\id_rsa.ppk” vol destroy vm002_smsdp_vm -f
“c:\Scripts\plink.exe” root@filer -i “c:\Scripts\id_rsa.ppk” vol destroy vm003_smsdp_vm -f
“c:\Scripts\plink.exe” root@filer -i “c:\Scripts\id_rsa.ppk” vol destroy vm004_smsdp_vm -f

echo * Create new snapshot, and rename older snapshots, deleting last one *
“C:\Program Files\NetApp\SnapDrive\sdcli.exe” snap rename -d E -o vm000.daily.3 -n vm000.daily.delete
“C:\Program Files\NetApp\SnapDrive\sdcli.exe” snap rename -d E -o vm000.daily.2 -n vm000.daily.3
“C:\Program Files\NetApp\SnapDrive\sdcli.exe” snap rename -d E -o vm000.daily.1 -n vm000.daily.2

“C:\Program Files\NetApp\SnapDrive\sdcli.exe” snap create -s vm000.daily.1 -D E

“C:\Program Files\NetApp\SnapDrive\sdcli.exe” snap delete -d e -s vm000.daily.delete

echo * Clone NetApp SMS Data volume based on most recent snapshot *
“c:\Scripts\plink.exe” root@filer -i “c:\Scripts\id_rsa.ppk” vol clone create vm001_smsdp_vm -s none -b vm000_smsdp_master vm000.daily.1
“c:\Scripts\plink.exe” root@filer -i “c:\Scripts\id_rsa.ppk” vol clone create vm002_smsdp_vm -s none -b vm000_smsdp_master vm000.daily.1
“c:\Scripts\plink.exe” root@filer -i “c:\Scripts\id_rsa.ppk” vol clone create vm003_smsdp_vm -s none -b vm000_smsdp_master vm000.daily.1
“c:\Scripts\plink.exe” root@filer -i “c:\Scripts\id_rsa.ppk” vol clone create vm004_smsdp_vm -s none -b vm000_smsdp_master vm000.daily.1

echo * Online NetApp LUN for SMS slaves to access *
“c:\Scripts\plink.exe” root@filer -i “c:\Scripts\id_rsa.ppk” lun online /vol/vm001_smsdp_vm/smsdp/smsdp.lun
“c:\Scripts\plink.exe” root@filer -i “c:\Scripts\id_rsa.ppk” lun online /vol/vm002_smsdp_vm/smsdp/smsdp.lun
“c:\Scripts\plink.exe” root@filer -i “c:\Scripts\id_rsa.ppk” lun online /vol/vm003_smsdp_vm/smsdp/smsdp.lun
“c:\Scripts\plink.exe” root@filer -i “c:\Scripts\id_rsa.ppk” lun online /vol/vm004_smsdp_vm/smsdp/smsdp.lun

echo * Recreate NetApp CIFS shares for SnapDrive to connect to *
“c:\Scripts\plink.exe” root@filer -i “c:\Scripts\id_rsa.ppk” cifs shares -add vm001_smsdp_vm$ /vol/vm001_smsdp_vm -f
“c:\Scripts\plink.exe” root@filer -i “c:\Scripts\id_rsa.ppk” cifs shares -add vm002_smsdp_vm$ /vol/vm002_smsdp_vm -f
“c:\Scripts\plink.exe” root@filer -i “c:\Scripts\id_rsa.ppk” cifs shares -add vm003_smsdp_vm$ /vol/vm003_smsdp_vm -f
“c:\Scripts\plink.exe” root@filer -i “c:\Scripts\id_rsa.ppk” cifs shares -add vm004_smsdp_vm$ /vol/vm004_smsdp_vm -f

echo * Enable SMS Share and start SMS service *
net share SMSPKGE$=E:\SMSPKGE$
net start CcmExec

REM —— end

The following script is then run on each of the other (slave) SMS deployment servers. This should be scheduled to run after the master clone, maybe 15-30 minutes later (just in case). In reality the first script takes 2-3 minutes at most. Change the 2 variables at the top to reflect the servername and IQN.

@echo off
servername=vm001
iqn=iqn.1991-05.com.microsoft:%servername%.domain.local

net stop CcmExec
net share SMSPKGE$ /delete

“C:\Program Files\NetApp\SnapDrive\sdcli.exe” disk disconnect -d E
“C:\Program Files\NetApp\SnapDrive\sdcli.exe” disk connect -p \\filer\%servername%_smsdp_vm$\smsdp\smsdp.lun -d E -I %servername% %iqn% -dtype dedicated

net share SMSPKGE$=E:\SMSPKGE$
net start CcmExec

General , , ,

  1. No comments yet.
  1. No trackbacks yet.



This site is not affiliated or sponsored in anyway by NetApp or any other company mentioned within.
%d bloggers like this: