lamw / vmware-scripts

Various scripts for VMware based solutions
http://www.williamlam.com/
BSD 2-Clause "Simplified" License
859 stars 489 forks source link

Could not establish trust relationship error get-vsanversion #82

Open mmohr1 opened 5 years ago

mmohr1 commented 5 years ago

Hey William, when running the Get-VSANVersion function I'm getting the error below. I checked to make sure the PowerCli Config was set to Ignore for InvalidCertificateAction. Is this something you've seen before?

$results = $vchs.VsanVcClusterQueryVerifyHealthSystemVersions($cluster_view)

Exception calling "VsanVcClusterQueryVerifyHealthSystemVersions" with "1" argument(s): "Could not establish trust relationship for the SSL/TLS secure channel with authority 'VC_NAME'." At line:1 char:1

lamw commented 5 years ago

Hm, I've not seen this before. Is the TLS certificate on your vCenter Server valid and not having any issues? Are you able to run the default vSAN cmdlets w/o issue or just using the function?

mmohr1 commented 5 years ago

Yes, get-vsanview works just fine. I tried running the script example for getting the vsan version from your blog one command at a time.

PS C:> get-vsanview

VsanClient MoRef


VMware.Vsan65.Views.VsanClientImpl VsanVcClusterConfigSystem-vsan-cluster-config-system VMware.Vsan65.Views.VsanClientImpl VimClusterVsanVcStretchedClusterSystem-vsan-stretched-cluster-system VMware.Vsan65.Views.VsanClientImpl VimClusterVsanVcDiskManagementSystem-vsan-disk-management-system VMware.Vsan65.Views.VsanClientImpl VsanVcClusterHealthSystem-vsan-cluster-health-system VMware.Vsan65.Views.VsanClientImpl VsanUpgradeSystemEx-vsan-upgrade-systemex VMware.Vsan65.Views.VsanClientImpl VsanSpaceReportSystem-vsan-cluster-space-report-system VMware.Vsan65.Views.VsanClientImpl VsanIscsiTargetSystem-vsan-cluster-iscsi-target-system VMware.Vsan65.Views.VsanClientImpl VsanObjectSystem-vsan-cluster-object-system VMware.Vsan65.Views.VsanClientImpl VsanPerformanceManager-vsan-performance-manager

PS C:> $vchs = get-vsanview -Id "VsanVcClusterHealthSystem-vsan-cluster-health-system" PS C:> $cluster_view = (Get-Cluster -name Management).ExtensionData.MoRef PS C:> $results = $vchs.VsanVcClusterQueryVerifyHealthSystemVersions($cluster_view) Exception calling "VsanVcClusterQueryVerifyHealthSystemVersions" with "1" argument(s): "Could not establish trust relationship for the SSL/TLS secure channel with authority 'VC_Name'." At line:1 char:1