powershell – vmware - netapp overview 1.installing netapp toolkit 2.installing vmware powercli
TRANSCRIPT
Powershell – Vmware - NetAppOverview
1. Installing NetApp Toolkit
2. Installing Vmware PowerCLI
Installing NetApp Toolkit
Requirements
Windows 7 or Windows 2008Powershell Version 2.0Download the NetApp Toolkit zip Unzip in :C:\Windows\System32\WindowsPowershell\v1.0\Modules
Testing NetApp Toolkit
Open Powershell
PS C:\> Get-Module –listavailable
ModuleType Name ExportedCommands---------- ---- ----------------Manifest AppLocker Manifest BitsTransfer Manifest DataONTAP Manifest PSDiagnostics Manifest TroubleshootingPack
Testing NetApp Toolkit
Open Powershell
PS C:\> Import-Module DataONTAPPS C:\> Connect-NaController 192.168.30.8
Name Address Ontapi Version---- ------- ------ -------192.168.30.8 192.168.30.8 1.15 NetApp Release 8.1RC2X13 7-Mode: Thu Oct 27 19:26:21 PDT 2011
Testing NetApp ToolkitOpen Powershell
PS C:\> Get-NaAggrSpace
AggregateName : aggr1SizeFree : 1257046016SizeMetadata : 95813632SizeNominal : 13212057600SizeSnapUsed : 0SizeUsed : 11955011584SizeVolumeAllocated : 11954601984SizeVolumeUsed : 86020096VolumeCount : 3Volumes : {NFSvol, nas, volvf}
Installing Vmware PowerCLI
Requirements
Windows 7 or Windows 2008Powershell Version 2.0Download the PowerCLI version 1.7Run the exe file
http://www.vmware.com/support/developer/windowstoolkit/wintk40u1/html/index.htmlFor all cmdlets explenations
Installing Vmware PowerCLI
Open PowerCLI from the icon on the desktop
PS C:\> Connect-VIServer -Server 192.168.4.10 -Protocol https -User root -Password netapp80PS E:\> Get-VM
Name PowerState Num CPUs Memory (MB)---- ---------- -------- -----------w7thin-template PoweredOff 1 2048w7-template PoweredOff 1 4096w2k8-template PoweredOff 1 4096w2k3-template PoweredOn 1 512sles-template PoweredOff 1 512sc2-7m-template PoweredOff 2 1600sc1-7m-template PoweredOn 2 1600
NetApp and VMware
PS C:\> Import-Module DataONTAPPS C:\> Connect-NaController 192.168.30.8
Name Address Ontapi Version---- ------- ------ -------192.168.30.8 192.168.30.8 1.15 NetApp Release 8.1RC2X13 7-Mode: Thu Oct 27 19:26:21 PDT 2011
Now you can use the cmdlets form NetApp and VMware
NetApp and VMware
ExamplesCreate new Volume
PS C:\> New-NaVol pwsvol -Aggregate aggr1 -SpaceReserve none -Size 5g
Name State TotalSize Used Available Dedupe FilesUsed FilesTotal Aggregate---- ----- --------- ---- --------- ------ --------- ---------- ---------pwsvol online 4,8 GB 76% 1,1 GB False 96 156k aggr1
NetApp and VMware
ExamplesCreate a SnapShot
PS C:\> New-NaSnapshot -TargetName pwsvol -SnapName pws_snap
Name Created Total Cumulative Dependency---- ------- ----- ---------- ----------pws_snap 7-3-2012
NetApp and VMware
ExamplesCreate a FlexClone
PS C:\> New-NaVolClone -ParentVolume pwsvol –CloneVolume pws_clone -SpaceReserve none –ParentSnapshot pws_snap
Name State TotalSize Used Available Dedupe FilesUsed FilesTotal Aggregate---- ----- --------- ---- --------- ------ --------- ---------- ---------pws_clone online 4,8 GB 77% 1,1 GB False 96 156k aggr1
NetApp and VMware
ExamplesMount NFS to ESX
PS C:\> New-Datastore -VMHost 192.168.4.10 -Name NFSPWS -Path /vol/pws_clone -Nfs -NfsHost 192.168.4.8
Name FreeSpaceMB CapacityMB---- ----------- ----------NFSPWS 1129 4864