5 Replies Latest reply on May 6, 2020 12:24 AM by drogal

    Connect-VIServer appears to not be working on CentOS 8

    drogal Lurker

      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
        • 1. Re: Connect-VIServer appears to not be working on CentOS 8
          LucD Guru
          Community WarriorsvExpertUser Moderators

          And which PowerCLI version did you use?

          Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
          • 2. Re: Connect-VIServer appears to not be working on CentOS 8
            drogal Lurker

            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, 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: **********************

             

            • 3. Re: Connect-VIServer appears to not be working on CentOS 8
              LucD Guru
              User ModeratorsvExpertCommunity Warriors

              Can you list all PowerCLI modules?

               

              Get-Module -Name VMware* -ListAvailable

              Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
              • 4. Re: Connect-VIServer appears to not be working on CentOS 8
                LucD Guru
                User ModeratorsCommunity WarriorsvExpert

                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_64.rpm

                 

                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.

                centos.png
                Not sure how you installed PSv7 and the PowerCLI modules, but I guess there might be an issue in your installation.

                Blog: http://lucd.info | Twitter: @LucD22 | PowerCLI Reference co-author: http://tinyurl.com/hkn4glz
                • 5. Re: Connect-VIServer appears to not be working on CentOS 8
                  drogal Lurker

                  Sorry to waste your time; it was selinux. My bad. It's all working now.