- Community Home
- >
- Storage
- >
- HPE Nimble Storage
- >
- Array Setup and Networking
- >
- Re: Automate ESX Datastore creation with Nimble Po...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-22-2014 10:09 AM
тАО01-22-2014 10:09 AM
Automate ESX Datastore creation with Nimble PowerShell Module
Here is a quick script that will add an additional volume to your ESX environment.
It requires the Nimble PowerShell Module and PowerCLI
#Connect to VCenter and Nimble Array
Connect-VIServer -Server $vcenter
Connect-NSArray -SystemName $ip -Password $password
#define settings
$vmhost = get-vmhost $VMHostName
$volumeName = "Nimble04"
$InitGroupName = "ESX"
$Size = 2tb
# Create a new volume
$vol = New-NSVolume -Name $volumeName -Size $Size -MultipleInitiator -PerformancePolicy 'VMware ESX 5'
# Provide the ESX hosts access to that volume
Add-NSInitiatorGroupToVolume -InitiatorGroup $InitGroupName -Volume $volumeName -Access Both
# Find the volume on the ESX host
$target = $vol.serialnumber
Get-VMHost -Server $nvm | Get-VMHostStorage -RescanAllHba
$lun = Get-ScsiLun -VmHost $vmhost -CanonicalName "eui.$target"
$canonicalName = $lun.canonicalname
# Create the new DataStore
New-Datastore -Name $volumeName -Path $canonicalName -Vmfs -VMHost $vmhost
Get-VMHost | Get-VMHostStorage -RescanAllHba
# Make sure the Multipathing is setup correctly (RoundRobin)
get-vmhost | Get-ScsiLun -CanonicalName $canonicalName | ?{$_.multipathpolicy -ne "RoundRobin"} | Set-ScsiLun -MultipathPolicy RoundRobin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-24-2014 05:21 PM
тАО01-24-2014 05:21 PM
Re: Automate ESX Datastore creation with Nimble PowerShell Module
Any reason why you're confirming the use of Round Robin for multipathing rather than using the Nimble Path Selection Plugin?
Nimble 2.0 PSP Integration with VMware vSphere Part I (VIB Install) | super sonic dog (S.S.D)
Should be out on Infosight also.Todd Moore
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-24-2014 09:55 PM
тАО01-24-2014 09:55 PM
Re: Automate ESX Datastore creation with Nimble PowerShell Module
I dont believe 2.0 is technically released yet, also I havent seen it before, looks pretty neat though.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-26-2014 10:45 AM
тАО01-26-2014 10:45 AM
Re: Automate ESX Datastore creation with Nimble PowerShell Module
Julian, one reason to still use the native RoundRobin is due to VMware licensing. To use a third-party PSP requires Enterprise or Enterprise Plus licensing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-27-2014 06:54 AM
тАО01-27-2014 06:54 AM
Re: Automate ESX Datastore creation with Nimble PowerShell Module
Hi Justin,
I've tried your script and everything work fine except for the the Performance policy. It appears that if the performance policy has spaces in it's name it will not read/apply regardless of whether it's in single of double quotes .... or indeed without.
In addition the embedded "VMware ESX 5" policy has spaces in it's name as do other standard policies but you cannot create a new performance policy through the Nimble Web interface with any spaces in the name .... as designed. Our array is a 460G on version 1.4.9..
If I use the default policy or create a new policy with no spaces it's fine.
Here's the error
"
New-NSVolume : Cannot validate argument on parameter 'PerformancePolicy'. The argument "VMware ESX 5" does not belong to
the set "default,ESX-5,'Exchange 2003 data store','Exchange 2007 data store','Exchange 2010 data store','Exchange
log',George-5,'Hyper-V CSV','Oracle OLTP',SharePoint,'SQL Server','SQL Server 2012','SQL Server Logs','VMware
ESX','VMware ESX 5','VMware VDI','Windows File Server'" specified by the ValidateSet attribute. Supply an argument that
is in the set and then try the command again.
At C:\NimblePowerShell-master\createDatastoreandVolume.ps1:13 char:89
+ ... formancePolicy $pp
+ ~~~
+ CategoryInfo : InvalidData: (:) [New-NSVolume], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,New-NSVolume
Add-NSInitiatorGroupToVolume : Error adding to the list! code: SMeinval
At C:\NimblePowerShell-master\createDatastoreandVolume.ps1:15 char:1
+ Add-NSInitiatorGroupToVolume -InitiatorGroup $InitGroupName -Volume $volumeName ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Add-NSInitiatorGroupToVolume"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-27-2014 08:43 AM
тАО01-27-2014 08:43 AM
Re: Automate ESX Datastore creation with Nimble PowerShell Module
hmm, so if you add the quotes it still gives the same error?
I had run in to the problem myself with the spaces but adding the quotes did it for me.
Im trying to dig in to it a bit more but from what i can tell its a bug in how tab expansion works. Im usind "dynamic parameter" which reads in the possibilities and makes that the validation set. I tried adding quotes as it read them in, but then it shows the quotes in the ISE intellisense.
However it really should accept it if you put it in quotes.
can you show me the line as you typed it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-27-2014 08:59 AM
тАО01-27-2014 08:59 AM
Re: Automate ESX Datastore creation with Nimble PowerShell Module
#Import the PowerCLI module
Add-PSSnapin VMware.VimAutomation.Core
$ip = "10.7.1.1"
$vcenter = "10.7.3.200"
$password = "NOWAYJose"
Connect-VIServer -Server $vcenter
Connect-NSArray -SystemName $ip -Password $password
$vmhost = get-vmhost Esxi-01.smbc.loc
$volumeName = "Nimble-123"
$InitGroupName = "ESXi-SMBC-CLUSTER-1"
$Size = 125gb
$pp = "default"
# Create a new volume
$vol = New-NSVolume -Name $volumeName -Size $Size -MultipleInitiator -PerformancePolicy $pp
# Provide the ESX hosts access to that volume
Add-NSInitiatorGroupToVolume -InitiatorGroup $InitGroupName -Volume $volumeName -Access Both
# Find the volume on the ESX host
$target = $vol.serialnumber
Get-VMHost -Server $nvm | Get-VMHostStorage -RescanAllHba
$lun = Get-ScsiLun -VmHost $vmhost -CanonicalName "eui.$target"
$canonicalName = $lun.canonicalname
# Create the new DataStore
New-Datastore -Name $volumeName -Path $canonicalName -Vmfs -VMHost $vmhost
Get-VMHost | Get-VMHostStorage -RescanAllHba
# Make sure the Multipathing is setup correctly (RoundRobin)
get-vmhost | Get-ScsiLun -CanonicalName $canonicalName | ?{$_.multipathpolicy -ne "RoundRobin"} | Set-ScsiLun -MultipathPolicy RoundRobin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-27-2014 09:01 AM
тАО01-27-2014 09:01 AM
Re: Automate ESX Datastore creation with Nimble PowerShell Module
instead of $pp = "default" it said $pp = "VMware ESX 5" I tried 'VMware ESX 5' and "'VMware ESX '5"
The previous script with "Default" ran OK.
Cheers,
Mark.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-27-2014 09:20 AM
тАО01-27-2014 09:20 AM
Re: Automate ESX Datastore creation with Nimble PowerShell Module
you know, im not sure i tried it with it being assigned to a variable, I always just typed it in on the new-snvolume line.
I'll play around with it that way and see what i come up with.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-27-2014 10:05 AM
тАО01-27-2014 10:05 AM
Re: Automate ESX Datastore creation with Nimble PowerShell Module
With or without the variable the outcome is the same.