- 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
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-27-2014 01:50 PM
тАО01-27-2014 01:50 PM
Re: Automate ESX Datastore creation with Nimble PowerShell Module
hmm so i just ran this line
New-NSVolume -Name "test" -Size 2tb -MultipleInitiator -PerformancePolicy 'VMware ESX 5'
and it ran successfully. when did you install the module? it could possibly be an older release that had a bug in it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-27-2014 09:28 PM
тАО01-27-2014 09:28 PM
Re: Automate ESX Datastore creation with Nimble PowerShell Module
Same line that failed for me. Have you got a pointer for the modules you used.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-28-2014 03:20 AM
тАО01-28-2014 03:20 AM
Re: Automate ESX Datastore creation with Nimble PowerShell Module
As per your link Justin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-28-2014 09:31 AM
тАО01-28-2014 09:31 AM
Re: Automate ESX Datastore creation with Nimble PowerShell Module
just to be safe, close powershell, delete the Nimble folder in the modules folder (my documents\windowspowershell\modules)
then open up powershell and run this
ex (new-object System.Net.WebClient).DownloadString('https://raw.github.com/jrich523/NimblePowerShell/master/Install.ps1')
also, what version of powershell are you using? nothing comes to mind as to why this wouldnt work in V2, but this is designed around V3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-29-2014 04:48 PM
тАО01-29-2014 04:48 PM
Re: Automate ESX Datastore creation with Nimble PowerShell Module
fixed the problem, you'll have to install it again (couple of code changes). you still need to manually supply the quotes, but at least now it works!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-30-2014 09:27 AM
тАО01-30-2014 09:27 AM
Re: Automate ESX Datastore creation with Nimble PowerShell Module
I'll give it a go tomorrow. I'm using PowerShell v3 and esxi 5.5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-30-2014 09:29 AM
тАО01-30-2014 09:29 AM
Re: Automate ESX Datastore creation with Nimble PowerShell Module
im actually making a few other modifications right now, so you'll want to download it again tomorrow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-01-2014 11:29 PM
тАО02-01-2014 11:29 PM
Re: Automate ESX Datastore creation with Nimble PowerShell Module
Worked a treat. Thanks. Need to learn Powershell basics and some to fully understand some of the snippets on here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-26-2015 08:26 AM
тАО02-26-2015 08:26 AM
Re: Automate ESX Datastore creation with Nimble PowerShell Module
I've tried running that same exact command and I'm receiving an error...
New-NSVolume : Error Creating volume test! code: SMeinval
At line:1 char:1
+ New-NSVolume -Name "test" -Size 2tb -MultipleInitiator -PerformancePolicy 'VMwa ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,New-NSVolume
I'm running PS version 3.0 and I'm running version 1.1.20140407.1024 of the Nimble module.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-21-2015 10:31 AM
тАО10-21-2015 10:31 AM
Re: Automate ESX Datastore creation with Nimble PowerShell Module
I am running the latest powershell module from GitHub, running powershell 4.0 and my nimbles are running 2.2.9.0-269169-opt. This is the command im running and the error im getting:
New-NSVolume -PerformancePolicy default -Name "test" -Description "test" -Size 500GB -MultipleInitiator
New-NSVolume : Error Creating volume test! code: SMeinval
At line:1 char:1
+ New-NSVolume -PerformancePolicy default -Name "test" -Description "test" -Size 5 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,New-NSVolume
New-NSVolume -PerformancePolicy "VMware ESX 5" -Name "test" -Description "test" -Size 500GB -MultipleInitiator
New-NSVolume : Error Creating volume test! code: SMeinval
At line:1 char:1
+ New-NSVolume -PerformancePolicy "VMware ESX 5" -Name "test" -Description "test" ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,New-NSVolume