August 25, 2011

PowerShell FlexVol Creation & LUN Clone

You're bored. You want to create something. You're creative.

See previous post about connecting to the controller.

Create the Volume:
New-NaVol -Name ma_test1 -Aggregate demo_aggr -Size 200G -SpaceReserve none -Controller $Filer -LanguageCode en_US

Create the LUN:
New-NaLun -Path /vol/ma_test1/na_test_lun1 -Size 100G -Controller $Filer -Unreserved
See previous post about the "$Filer" bit

Create a Snapshot:
New-NaSnapshot -TargetName -ma_test1 -Controller $Filer -SnapName snap_with_lun1

Great. So what?
You might want to clone the entire volume to a separate space because you want to do some work that might fill the volume up and you don't want to risk taking the LUN offline **

But you might just want to clone the LUN because you're just having a quick delve in to the snapshot to see some data or restore something you took a snapshot of at some previous time.

Clone the LUN:
New-NaLunClone -ClonePath /vol/ma_test1/ma_test_lun1_cl -ParentPath /vol/ma_test1/ma_test_lun1 -ParentSnapshot snap_with_lun1

** The point here is that you might be being careful about where you put data or the storage admin might not have given you the right to create a cloned volume. Perhaps the storage people want to keep you fairly cleanly inside your own box. A FlexClone creates a new volume whereas a LUN Clone creates a zero space clone inside the existing FlexVol.



0 comments: