I see several posts over the years regarding differences in the way the newer versions of the PowerShell toolkit are able to retrieve information when using ZAPI calls vs. presumably the REST API. The response from Support is that this is outside the scope of a technical support case and to start a discussion here on the subject. I am working with my local account team, also. Anyway... I figured I'd finally post here due to the most recent versions displaying increasingly threatening notifications that support for ZAPI will be dropped. I can collect debug logs if necessary as it is always requested in threads that mention this issue... but hopefully by now that won't be necessary since this isn't a new issue and it should be well known to anyone who uses the PSTK, and hopefully a definitive solution or at least a statement as to the actual status could be posted publicly. Here's an example of some REALLY basic info that's missing when not using ZAPI: PS:02/21/25 09:14:47 [hostname_redacted]> Get-NcNode | Format-Table -AutoSize -Property Node,IsNodeHealthy,IsNodeClusterEligible
Node IsNodeHealthy IsNodeClusterEligible
---- ------------- ---------------------
[hostname_redacted]-06 True
[hostname_redacted]-08 True
[hostname_redacted]-05 True
[hostname_redacted]-07 True
PS:02/21/25 09:15:19 [hostname_redacted]> Get-NcNode -ZapiCall | Format-Table -AutoSize -Property Node,IsNodeHealthy,IsNodeClusterEligible
Node IsNodeHealthy IsNodeClusterEligible
---- ------------- ---------------------
[hostname_redacted]-05 True True
[hostname_redacted]-06 True True
[hostname_redacted]-07 True True
[hostname_redacted]-08 True True
PS:02/21/25 09:15:27 [hostname_redacted]>
PS:02/21/25 09:54:44 [hostname_redacted]> Get-NcAggr
Name State TotalSize Used Available Disks RaidType RaidSize Volumes
---- ----- --------- ---- --------- ----- -------- -------- -------
data1_[hostname_redacted]_07 online 208.1 TB 105.2 TB 29 29
data1_[hostname_redacted]_05 online 183.0 TB 85.6 TB 65 22
data1_[hostname_redacted]_08 online 208.1 TB 133.7 TB 29 29
data2_[hostname_redacted]_07 online 208.1 TB 129.4 TB 29 29
data1_[hostname_redacted]_06 online 245.1 TB 136.3 TB 87 22
data2_[hostname_redacted]_08 online 208.1 TB 131.6 TB 29 29
PS:02/21/25 09:54:50 [hostname_redacted]> Get-NcAggr -ZapiCall
Name State TotalSize Used Available Disks RaidType RaidSize Volumes
---- ----- --------- ---- --------- ----- -------- -------- -------
aggr0_[hostname_redacted]_05 online 6.2 TB 48% 3.3 TB 4 raid_dp, normal 14 2
aggr0_[hostname_redacted]_06 online 6.2 TB 48% 3.3 TB 4 raid_dp, normal 14 2
aggr0_[hostname_redacted]_07 online 3.1 TB 95% 152.0 GB 3 raid_dp, normal 14 2
aggr0_[hostname_redacted]_08 online 3.1 TB 95% 152.1 GB 3 raid_dp, normal 14 2
data1_[hostname_redacted]_05 online 183.0 TB 53% 85.6 TB 76 mixed_raid_t... 22 77
data1_[hostname_redacted]_06 online 245.1 TB 44% 136.3 TB 98 mixed_raid_t... 22 80
data1_[hostname_redacted]_07 online 208.1 TB 49% 105.2 TB 52 mixed_raid_t... 29 76
data1_[hostname_redacted]_08 online 208.1 TB 36% 133.7 TB 52 mixed_raid_t... 29 78
data2_[hostname_redacted]_07 online 208.1 TB 38% 129.4 TB 52 mixed_raid_t... 29 88
data2_[hostname_redacted]_08 online 208.1 TB 37% 131.6 TB 52 mixed_raid_t... 29 108
PS:02/21/25 09:54:57 [hostname_redacted]>
... View more
I am recently learning powershell scripting, how can I write scripts to successfully access adv permissions, I tried to pass y after set adv, but it didn't work, I don't know how to solve this problem, hope someone can help modify my script my script # Set connection information $ONTAPHost = Read-Host "Enter the IP address of the ONTAP cluster" $User = Read-Host "Enter username" $Password = Read-Host "Enter password" $OutputFile = "commands_output.txt" # Output file path # Import Posh-SSH module from removable drive, need to change the drive letter Import-Module F:\Posh-SSH # Create an SSH session and pass credentials $securePassword = $Password | ConvertTo-SecureString -AsPlainText -Force $credential = New-Object System.Management.Automation.PSCredential($User, $securePassword) # Define command array $commands = @( "cluster show", "set adv", "system node image show" ) # Try to connect to the ONTAP cluster try { # Creating an SSH Session $session = New-SSHSession -ComputerName $ONTAPHost -Credential $credential -ErrorAction Stop Write-Host "SSH session established successfully." # If the file already exists, clear the file contents if (Test-Path $OutputFile) { Clear-Content -Path $OutputFile } # Loop through the array of commands and execute them in turn foreach ($command in $commands) { Write-Host "`nExecuting command: $command" try { # Execute the current command and get the result $result = Invoke-SSHCommand -SessionId $session.SessionId -Command $command -ErrorAction Stop # Record the command execution to a file Add-Content -Path $OutputFile -Value "`n::> $command" # Output the result of the command if ($result.Output) { $result.Output -split "`n" | ForEach-Object { Add-Content -Path $OutputFile -Value $_ } } else { Add-Content -Path $OutputFile -Value "No output received for '$command'." } } catch { Write-Host "Error executing command: $command" Add-Content -Path $OutputFile -Value "Error executing command: $command - $_" } } } catch { Write-Host "Failed to establish SSH session or execute command: $_" Add-Content -Path $OutputFile -Value "Failed to establish SSH session or execute command: $_" exit } finally { # Make sure to close the SSH session at the end of the script if ($session) { Remove-SSHSession -SessionId $session.SessionId Write-Host "SSH session closed." } } outputfile ::> cluster show Last login time: 11/25/2024 16:21:20 Node Health Eligibility --------------------- ------- ------------ FAS2720-01 true true FAS2720-02 true true 2 entries were displayed. ::> set adv Last login time: 11/25/2024 16:22:14 ::> system node image show Last login time: 11/25/2024 16:22:14 Error: "image" is not a recognized command
... View more
We have data centers around the world so we have different time zones, it would help if we configure it they way it is in 7DOT, for example: 7CODT hourly.0 in cDOT it is hourly.2013-11-15_0401
... View more