Running CentOS 8 and tcpdump shows that no outbound connections are attempted when I run Connect-VIServer. Has anyone noticed this?
Also, I can Ctrl+C to stop the Connect-VIserver because it does not appear to timeout. Exiting pwsh requires Ctrl+Z to background it and then kill %1.
Something is definitely broken.
Powershell installed from the official repo and PowerCLI modules unzipped into /opt/microsoft/powershell/7/Modules/VMware.PowerCLI
$> dnf info powershell Name : powershell Version : 7.0.0 Release : 1.rhel.7 Architecture : x86_64 Size : 151 M Source : powershell-7.0.0-1.rhel.7.src.rpm Repository : @System From repo : packages-microsoft-com-prod Summary : PowerShell is an automation and configuration management : platform. URL : https://microsoft.com/powershell License : MIT License Description : PowerShell is an automation and configuration management : platform. It consists of a cross-platform command-line shell and : associated scripting language. PS> Get-Module | ? {$_.Name -like "*vmware*"}| select Version, Name Version Name ------- ---- 7.0.0.15939650 VMware.Vim 12.0.0.15939657 VMware.VimAutomation.Cis.Core 12.0.0.15939652 VMware.VimAutomation.Common 12.0.0.15939655 VMware.VimAutomation.Core 12.0.0.15939651 VMware.VimAutomation.Sdk PS> $PSVersionTable Name Value ---- ----- PSVersion 7.0.0 PSEdition Core GitCommitId 7.0.0 OS Linux 4.18.0-147.8.1.el8_1.x86_64 #1 SMP Thu Ap… Platform Unix PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 WSManStackVersion 3.0 PS> $vcenter = "HIDDEN" PS> Test-Connection -TargetName $vcenter -TcpPort 443 True PS> Connect-VIServer $vcenter Specify Credential Please specify server credential User: HIDDEN Password for user HIDDEN: ********************** ^C
And which PowerCLI version did you use?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
apologies, but the formatting is non-obvious:
$ dnf info powershell
Last metadata expiration check: 0:08:46 ago on Tue 05 May 2020 13:18:50 BST.
Installed Packages
Name : powershell
Version : 7.0.0
Release : 1.rhel.7
Architecture : x86_64
Size : 151 M
Source : powershell-7.0.0-1.rhel.7.src.rpm
Repository : @System
From repo : packages-microsoft-com-prod
Summary : PowerShell is an automation and configuration management
: platform.
URL : https://microsoft.com/powershell
License : MIT License
Description : PowerShell is an automation and configuration management
: platform. It consists of a cross-platform command-line shell and
: associated scripting language.
PS> Get-Module | ? {$_.Name -like "*vmware*"}| select Version, NameVersion Name
------- ----
7.0.0.15939650 VMware.Vim
12.0.0.15939657 VMware.VimAutomation.Cis.Core
12.0.0.15939652 VMware.VimAutomation.Common
12.0.0.15939655 VMware.VimAutomation.Core
12.0.0.15939651 VMware.VimAutomation.Sdk
PS> $PSVersionTable
Name Value
---- -----
PSVersion 7.0.0
PSEdition Core
GitCommitId 7.0.0
OS Linux 4.18.0-147.8.1.el8_1.x86_64 #1 SMP Thu Ap…
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
PS> $vcenter = "HIDDEN"
PS> Test-Connection -TargetName $vcenter -TcpPort 443
True
PS> Connect-VIServer $vcenter
Specify Credential
Please specify server credential
User: HIDDEN
Password for user HIDDEN: **********************
Can you list all PowerCLI modules?
Get-Module -Name VMware* -ListAvailable
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Just to make sure, I did a quick test setup with CentOS 8.
For me everything seems to be working ok.
First install PSv7 with
sudo yum install https://github.com/PowerShell/PowerShell/releases/download/v7.0.0/powershell-lts-7.0.0-1.rhel.7.x86_...
Then start PSv7 with 'pwsh'.
In the PSv7 session install PowerCLI and if required bypass certificate checking.
Install-Module -Name VMware.PowerCLI -Force -Confirm:$false -AllowClobber
Set-PowerCLIConfiguration -InvalidCertificateAction:Ignore -Confirm:$false
The connect and run a PowerCLI cmdlet
Connect-VIServer -Server <my-vcsa>
Get-VMHost
And all that seems to work correctly for me.
Not sure how you installed PSv7 and the PowerCLI modules, but I guess there might be an issue in your installation.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Sorry to waste your time; it was selinux. My bad. It's all working now.