Also - I'm seeing this as well - PS C:\powershell> invoke-nassh -command "software install all_shelf_fw.zip" software: installing software, this could take a few minutes... software: installation of all_shelf_fw.zip completed. sw_find_kernel: exec_status=1 WARNING: software: installation of all_shelf_fw.zip was not successful. If I check the messages log, I see the following Tue Jan 29 10:18:12 EST [filerb:cmds.software.installDone:info]: Software: Installation of all_shelf_fw.zip was completed. Tue Jan 29 10:18:12 EST filerb:cmds.software.installNotDone:info]: Software: Installation of all_shelf_fw.zip failed. So has it completed or has it not completed. ?? Wierd..
... View more
Vinith - I'm very familiar with invoke-nassh. I try to avoid using that b/c I would rather use the standard cmdlet's from powershell but I didn't find anything that suited software install. So, in my opinion, start-nadiskupdate is not very useful b/c if you have the proper options on, once you do a software install the disks automagically start to upgrade. As for shelf firmware upgrade, you would have to initiate a software install all_shelf_fw.zip and then do a storage download shelf from a controller. I can initiate a invoke-nassh -command "software install all_shelf_fw.zip" and then do start-nashelfupdate. I am currently using ontap toolkit 2.1 with PS 3.0 I can upgrade to 2.2
... View more
Hey all - So, I have some questions regarding start-nadiskupdate and start-nashelfupdate. I've written a simple script to copy the firmware files from our http server over to each filer... #### cls $file = read-host "enter File list" $ftype = read-host "enter file you want to copy" $Hosts = gc $file $Hosts | % { $filer = $_ Write-Host "Copying $ftype to filer" $_ copy-item -path "\\httpserver\c$\home\http\firmware\$ftype" -destination "\\$filer\etc$\software" -force } ### I've also done it this way as well - ## $warningpreference = "SilentlyContinue" #### Reset registry key ## Set credentials $pwd = Read-Host "enter password" cls $password = ConvertTo-SecureString $pwd -AsPlainText -Force $cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList "northamerica\jgoldfar",$password $file = read-host "enter File list" $Hosts = gc $file $Hosts | % { #Write-Host Connecting to controller: $_ $c = connect-nacontroller $_ -https -cred $cred Write-Host "Copying All.zip to filer" $_ Invoke-NaSsh -command "software get http://httpserver/firmware/all.zip -f" } ### I prefer option 1. So, let's say we get the firmware files to the software directory. Now I wanted to play around with get-nadiskupdate and get-nashelfupdate. I was surprised to know that these cmdlets don't actually do some sort of software install all.zip or all_shelf_fw.zip. So, when I ran get-nadisk | start-nadiskupdate - I saw in the messages file that all disks are updated. Obviously, it didn't do a software extract. Am I now forced to go back to connecting via https and issuing the commands via ssh? I didn't find a powershell cmdlet that will do software install. Also - as per the man page on start-nadiskupdate - I tried this. PS C:\powershell> start-nadiskupdate start-nadiskupdate : Value cannot be null. Parameter name: value At line:1 char:1 + start-nadiskupdate + ~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (uswsns015a:NaController) [Start-NaDiskUpdate], ArgumentNullException + FullyQualifiedErrorId : ApiException,DataONTAP.PowerShell.SDK.Cmdlets.Disk.StartNaDiskUpdate I'm using version 2.1. Thanks all in advance.
... View more
This seems like a pretty complex request. Do you have something that you started to work on? Also, you can use standard windows scripting to look for the presence of the snapdrive service, but i'm not sure what API's or powershell cmdlets are available if any for snapdrive other than SDCLI
... View more
Hmm.. This isn't something I can "test" b/c I can't halt a filer. Have you tried to run the commands line by line Also you should create an array of your controllers $hosts = @("filer1","filer2") $user = "root" $password = ConvertTo-SecureString "password" -AsPlainText -Force $cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $user,$password $hosts | % { $filer = $_ WRite-host "Connecting to Controller: " $Filer $C = connect-nacontroller $filer -https -credential $cred write-host "Halting Filer..... " Invoke-NaSsh -Command 'halt -t 0' }
... View more
Stefan, Somethings seems off here whats the name of your vif, for example vif10g $int = get-nanetinterface vif10g $int | gm (gives you all the properties) But you should be able to do something as simple as get-nanetinterface vif10g | Set-nanetinterface vif10g -mtusize 9000 -confirm -verbose
... View more
Ah - hash table, Cool. Thx... So.. anyways,.. I still need to get it in a format where it shows all the true columns, better for report, but here's my thought process around scripting new vols when provisioning snapmirror targets or just messing around in the lab $vols | % { if ($_.snapshotpercentreserved -eq 0) { write-host "No Snapshot Reserve Name: " $_.name } new-navol -name $_. name -aggregate aggr1 -spacereserve none -size $_.totalsize -controller $dstfiler elseif ($_.snapshotpercentreserved -gt 0) { write-host "Snapshot reserve volume: " $_.name "`tSnapshotReserve%" $_.snapshotpercentreserved} $volsize = get-navolsize $_.name new-navol -name $_. name -aggregate aggr1 -spacereserve none -size $volsize -controller $dstfiler } ## Close loop } That was my thought process... I haven't tested the above code, but in theory it should work.
... View more
Clinton - This is brilliant as usual. I'm sitting here wondering how you are stuffing the array, and why I can' t pull aggregate information as well.. I basically want $volsizemap array to encompass stuff from get-navol, So example, I really want $_.totalsize $_.totalused - etc... I'm having trouble with the concept of this array. I just don't understand it and i'll be the first to admit it.
... View more
So Clinton - i've been racking my brain for a little to try to figure out the best way to get a better representation of the storage.. I was trying stuff like $vols = get-navol $vols | % { $volsize = get-navolsize $_.name | Select @{E={convertto-formattednumber $_.volumesize datasize "0.00"} Write-host "Volume name: " $_.name "`tVolumeSize: " $volsize } But that totally fails.. Ultimately, I would like to be ale to get true volume size as to when we build a new filer, and snapshot reserve is set I can get the true volume size and as well for reporting.. Where am I going wrong here?
... View more
Clinton - Thx for the reply - I agree with your statement on multiple calls, but the get-navol totalsize isn't a true representation.. I can't believe i've missed this before, most of the time, i deal with snapshot reserve of 0, but it just so happens, I was looking at this closer today and they didn't jive.
... View more
Clinton - get-navol vol0 | get-navolsize | Select @{E={convertto-formattednumber $_.volumesize datasize "0.00"};N = "Volumesize"} That wll give us the true vol size if snapshot reserve is on. Hmm. To me, I feel like we should represent that in Get-navol, For example, if I want to provision a new filer, i use the $_.totalsize property to do so, but that's technically incorrect.
... View more
Clinton - Good point.. I just checked it's totally snapshot reserve.. Omg, I totally overlooked that... I know this is off topic from the original thread, but to me that makes things pretty confusing.. I was under the impression that get-navol was similiar to vol size where it tells you the entire volume.. If snapshot reserve is enabled at 20% it can totally throw off the automation of scripting..
... View more
There is one issue i am having and i'm wondering what it could be.. from the console if i run aggr show_space -g or vol size on a specific volume it shows as 4560GB, but with powershell it shows 3.5tb. Wierd, I can't figure that one out.
... View more
Clinton - Your a genius! Well that sure makes things easier... get-navol | measure-object Totalsize,Available,sizeused -Sum | select -expandproperty Sum | Convertto-formattednumber -type Datasize Now, I just need to play around with getting into each aggr info.. sort of like aggr show_space -g, but neater...
... View more
So this is a basic simple question, when using the convertto-formattednumber cmdlet it nicely formats the data into either TB, GB, MB, etc.... I've been looking at the cmdlet and seeing if there is a way to make the output consistent in either all GB or TB, etc.. I've been unsuccessful. What i've done so far, it's ugly, but it's my desired result is something like this.. get-navol | Select Name,Aggregate,@{E={[Math]::round(($_.Totalsize/(1024*1024))/1024,2)};Name = "Total Size (GB)"},@{E={[Math]::round(($_.sizeused/(1024*1024))/1024,2)};N = "Used (GB)"},@{E={[Math]::round(($_.Available/(1024*1024))/1024,2)};N = "Available (GB)"} | Sort Aggregate | ft -autosize The only reason why i'm doing this is quick calculation to excel to figure out free space on the aggrs quickly.. you can just add them up in excel if you pipe to export-csv Just curious if there was an easier way
... View more
what your asking for is some advanced scripting... especially with Excel integration.. Do you know how to at least connect to a controller/vfiler via ps?
... View more
Mad props to Glenn Sizemore for the foundation.... This will give me the output i want to see when i'm looking for igroups and lun mappings. The important thing here is whether or not your initiator is logged in or not. That was key for us.. FYI - you can feed a txt file full for filers if you want. Please comment and let me know if we can improve on this. #### Code##### $hosts = @("filer1","filer2") $hosts | % { Write-Host "`n`tConnecting to Filer: $_" $filer = $_ Write-Host "`t-------------------------------------------------------" $c = Connect-NaController $_ $igroups = Get-NaIgroup $LunInfo = Get-NaLun -Terse | Get-NaLunMap | Group-Object Name foreach ($igroup in $igroups) { Write-Host "`n`tigroup Name: " $Igroup.Name Write-Host "`t`tOS_Type: " $Igroup.type Write-Host "`t`tProtocol: " $Igroup.protocol $initiators = $igroup.initiators | Select -expandproperty 'initiatorname' $initiators | % { $name = $_ if ($name -ne $null) { if ((Confirm-NaLunInitiatorLoggedIn -Initiator $name) -eq $false) { Write-Host "`t`t`tInitiator Not logged in: " $name } else { Write-Host "`t`t`tInitiator Logged in: " $name } } Else { Write-Host "`t`t`tNo initiators assigned to Igroup" } } # Write-Host "`t`tinitiators: " $(($igroup.initiators|Select-Object -ExpandProperty InitiatorName) -join " ") Write-Host "`t`tLuns --------------------------------------------------" #"# LUN ID LUN Path" foreach ($lun in ($LunInfo| where {$_.Name -eq $igroup.Name} | select -ExpandProperty Group)) { Write-Host "`t`t`tLUN:" $lun.lunID ":" $lun.path } } Write-Host "`n`tEnd of Filer: $filer " # Close }
... View more
So, this is most likely a user error, but i've upgrade to v2.1 ran, show-nahelp and i'm returned with " PS C:\test> show-nahelp WARNING: Could not find help files " So, i figured it was me, I did a complete uninstall of the toolkit (uninstall.ps1) and then I reinstalled it and executed the command again. Same result. now I know the files are there b/c i'm browsing to it file:///C:/Windows/System32/WindowsPowerShell/v1.0/Modules/DataONTAP/webhelp/cmdlets.html what gives?
... View more
Thanks. You and clinton always get me moving in the correct direction. And i'm all about sharing.. that's how everyone learns and is able to use the awesome powershell snapins..
... View more
I know some of you out there use aliases, upon checking I figured I would add it.. Add this do the code $existingaliases = Get-NaFcpPortNameAlias -Controller $sourcecontroller ## Set Aliases via looping through it If ($existingaliases -ne $null) { foreach ($alias in $existingaliases) { Set-NaFcpPortNameAlias -PortName $alias.aliaseswwpn -Alias $alias.aliasesalias -Controller $dstcontroller -Force -Verbose } } Enjoy!
... View more
Forgot to add Glenn's check for ALUA.. That's all i'm concerned with.. Throw this in the for loop ## ADD alua check if ($Igroup.InitiatorGroupAluaEnabled -eq $true) { Write-Host "Adding ALUA to Igroup:" $Igroup.name Set-NaIgroup -Name $Igroup.name -Key alua -Value $IGroup.InitiatorGroupAluaEnabled -Controller $dstcontroller -Force }
... View more