Skip to main content

The underlying connection was closed: An unexpected error occurred on a send




Attempting to use VMware vSphere PowerCLI's Connect-VIServer to a vCenter instance fails with: "The underlying connection was closed: An unexpected error occurred on a send." 

Problem

You have VMware vSphere PowerCLI version 5.1.0.4977 installed:









 


using the Connect-VIServer cmdlet but it immediately fails with:
PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI> Connect-VIServer vCenter.contoso.local
Connect-VIServer : 2/22/2019 11:41:37 AM Connect-VIServer The underlying connection was closed: An unexpected error
occurred on a send.
At line:1 char:1
+ Connect-VIServer vCenter.contoso.local
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Connect-VIServer], ViError
+ FullyQualifiedErrorId : Client20_ConnectivityServiceImpl_Reconnect_WebException,VMware.VimAutomation.ViCore.Cmdl
ets.Commands.ConnectVIServer




PowerCLI C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI>


 


Solution
The reason why this error is thrown is because vCenter 6.7 only has TLS 1.2 enabled while TLS 1.0 and 1.1 is disabled by default so the older PowerCLI version installed, which attempts to connect via a one of the lower TLS versions will fail. The proper method of resolving this issue is to upgrade the old PowerCLI version to the latest one with the cmdlet Install-Module -Name VMware.PowerCLI

Another way type below command
#FORCE POWERCLI TO USE TLS1.2
=============================
PowerCLI E:\git> [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12



Comments

Popular posts from this blog

Dell EMC VxRail – VMware Virtual SAN Stretched Cluster

Logical Diagram of VMware vSAN Stretched Cluster Physical Diagram of VMware vSAN Stretched Cluster Last week I deployed a test environment of VMware vSAN Stretched Cluster which is running on Dell EMC VxRail Appliance. In this post we will describe how to setup VMware vSAN Stretched Cluster on Dell EMC VxRail Appliance. Above figure is the high level of physical system diagram. In site A/B there are six VxRail Appliances and two 10GB Network Switch which are interconnected by two 10GB links, and each VxRail Appliance has one 10GB uplink connects to each Network Switch. In site C, there are one vSAN Witness host and one 10GB Network Switch. For the details of configuration of each hardware equipment in this environment, you can reference the followings. Site A (Preferred Site) 3 x VxRail E460 Appliance Each node includes 1 x SSD and 3 x SAS HDD, 2 x 10GB SFP+ ports 1 x 10GB Network switch Site B (Secondary Site) 3 x VxRail E460 Appliance Each node includes 1 x SSD and...

UEFI Secure Boot with ESXi 6.5

UEFI Secure Boot: UEFI, or Unified Extensible Firmware Interface, is a replacement for the traditional BIOS firmware. In UEFI, Secure Boot is a “protocol” of the UEFI firmware. UEFI Secure boot ensures that the boot loaders are not compromised by validating their digital signature against a digital certificate in the firmware. UEFI can store whitelisted digital certificates in a signature database (DB). There is also a blacklist of forbidden certificates (DBX), a Key Exchange Keys (KEK) database and a platform key. These digital certificates are used by the UEFI firmware to validate the boot loader.  Boot loaders are typically cryptographically signed and their digital signature chains to the certificate in the firmware.The default digital certificate in almost every implementation of UEFI firmware is a x509 Microsoft UEFI Public CA cert. Most of the UEFI implementations also allows the installation of additional certificate in the UEFI firmware and UE...

VMware Interview Questions & Answers

These interview questions are categorized into the following technical areas: Hypervisor Fault Tolerance (FT) Virtual Networking vCenter Server Virtual Storage (Datastore) What’s New in vSphere 6.0 Content Libraries vSAN vApp and Miscellaneous Hypervisor What is VMKernel and why it is important? VMkernel is a virtualization interface between a Virtual Machine and the ESXi host which stores VMs. It is responsible to allocate all available resources of ESXi host to VMs such as memory, CPU, storage etc. It’s also controlled special services such as vMotion, Fault tolerance, NFS, traffic management and iSCSI. To access these services, VMkernel port can be configured on ESXi server using a standard or distributed vSwitch. Without VMkernel, hosted VMs cannot communicate with ESXi server. What is the hypervisor and its types? A hypervisor is a virtualization layer that enables multiple operating systems to share a single hardware host.  Each operating syste...