Open DanPhonovation opened 2 years ago
So I tried doing the troubleshooting step is non-Core powershell, and the result is different! I get a result from Get-VsanClusterConfiguration.
Now I'm kind of confused.
Get-VsanClusterConfiguration fails with this:
PS C:\Windows\System32> $PSVersionTable
Name Value
---- -----
PSVersion 7.2.2
PSEdition Core
GitCommitId 7.2.2
OS Microsoft Windows 10.0.19043
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
But does not with:
PS C:\Windows\system32> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.19041.1320
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.1320
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Yet you're calling for PowerShell core specifically.
I looked up your latest date (11 months ago) and matched the latest stable release at the time, and it passes the sniff test. Get-VsanClusterConfiguration works with PowerShell Core 7.0 but not 7.2. Not sure about 7.1
PS C:\Program Files\PowerShell\7> $PSVersionTable
Name Value
---- -----
PSVersion 7.0.6
PSEdition Core
GitCommitId 7.0.6
OS Microsoft Windows 10.0.19043
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
^^^^ Works
I suggest changing (until a further update by yourself) the line that says "latest version of PowerShell Core" for now.
PS C:\Program Files\PowerShell\7> Get-VsanClusterConfiguration
Cluster VsanEnabled IsStretchedCluster Last HCL Updated
------- ----------- ------------------ ----------------
Workload-Cluster True False 29/03/2022 16:19:00
Just confirmed this as well. I was on PSVersion 7.2.2 (VSCode auto upgraded from my previous working version) and was hitting this error.
Reinstalled PSVersion 7.0.0 and the script works fine again.
Thanks for posting the workaround @DanPhonovation !
I've matched all the versions as described in this document. Even PowerCLI from 12.5 to 12.0. I've tried several rounds now.
Script gets as far as
"Enabling VSAN & disabling VSAN Health Check ..."
The commands thereafter fail with:
All the VMs seem deployed. I can actually login to VCSA (which clearly shows some setup problems, as expected. Script isn't done).
I manually connect to it with Connect-VIServer and issue a simple "Get-VsanClusterConfiguration" and I get the same error. Not sure how to proceed.
I sure would like a lab without building it from the ground up myself. Heh.