VMware Cloud Community
the_gonzo
Contributor
Contributor

Get-VM Generates Error: Unable to read data from the transport connection

When I try to use WindowsPowershell or vSpher PowerCLI to excute Get-VM or Get-VM Server "mysrvname" I get the below error. Other commands work fine. I'm at wits, please help!

These work fine

Get-VMHost

Get-Template

Get-Cluster

D:\Program Files\VMware\Infrastructure\vSphere PowerCLI> Get-VM

Get-VM : 10/16/2009 12:35:16 AM ***Get-VM 5EA98C9E-8AEC-4EEA-9251-B214481D908B Unable to read data from the transport connection: The connection was closed.***

*At line:1 char:6*

+ Get-VM <<<<

Additional Info, that might help...

VMware vCenter Server 4.0.0 build-162856

VMware ESX 3.5.0 build-123630

VMware ESX 3.5.0 build-163429

VMware ESX 4.0.0 build-164009

VMware ESX 4.0.0 build-175625

0 Kudos
10 Replies
ctrople
Enthusiast
Enthusiast

Are you trying to get all VMs for a particular host?

Does this work?

Get-VMHost -Name <name> | Get-VM

======================================

Chyna Trople, VCP

Monitor. Correlate. Act. | vWire.com

======================================

Chyna Trople, VCP Monitor. Correlate. Act. | vWire.com
0 Kudos
StueyC
Contributor
Contributor

I have the same issues concerning get-vm,

simply entering get-vm returns:

Get-VM : 28-Oct-09 22:56:23 Get-VM DCE8573B-36CD-4D24-B1B6-DD99FEC8CE3E Unable to read data from the transport connection: The connection was closed.

whilst the following works fine

get-host -name server|get-vm

this has just stopped working...previously it worked.....have rebooted VC but this has made no difference......

all ideas welcome!

Stu.

0 Kudos
houghtp
Contributor
Contributor

We had the same error, managed to track it down to a specific host. Running get-vmhost | get-vm would work so far but would give this error when trying to get VM's from this host. Removing the host from the cluster and re-adding fixed it.

0 Kudos
StueyC
Contributor
Contributor

thanks - that is looking promising.

I have individually connectedto each ESX box using cnnect v-server followed by a get-vm - in all cases this as returned alist of vm's - so no probems deteced using this method.

I the connected to virtual center and ran

get-vm -location <clusterame>

we have 6 clusters - his identified which cluste has the issue

then ran

get-vm -location <ESXsererName>

for each ESX hostin the cluste and finally idetified the no returning th error. We will evacuate the vms from the host and try removing/rejoing it to the cluster over the weekend. I will repor back success/failure on this.....

but already ths hs narrowed down the root cause of the issue.

thanks

Stu.

0 Kudos
houghtp
Contributor
Contributor

No need to to migrate VM's of the host to remove it from the cluster, but be aware you will loose any Custom Fields you have set against VM's on this host when you remove it from the cluster.

0 Kudos
the_gonzo
Contributor
Contributor

OK, really wierd stuff going on. Let me explain. A couple of days after I posted this, the Get-VM query started working fine. We didn't do anything to our environment. When it wasn't working Get-VM or Get-VM myserver00 wasn't working. Since it was working I didn't care to get to the root cause. Today I come in, and again it doesn't work (Get-VM or Get-VM myserver00). I then connect dirrectly to all my ESX hosts (excluding the vSphere server from the equation) and it works fine. I then thought it was an issue with the vSphere server, so I restarted the 2 services on vSphere

VMware VirtualCenter Server

VMware VirtualCenter Management Webservices

This didn't help, so I rebooted the server. Same results. Really wierd!

0 Kudos
StueyC
Contributor
Contributor

..wehave seen similar here also. We didnt get to the poin of remving and re-adding teh host widntified with the problem to the cluster. It juststared working after a week. We had previously rebooted VC which had o effec. The only action w took thi weekend was o stopand restart the web servies on VC.

...on issue I had benpreviously unaware of was the search function on VC was not working. This is working....along of course with the get-vm.

Gonzo: when connecting to individua vmhosts....did you do this through connecting o VC and thenusing get-vm -location <fqdn-vmhostnme> ?

I ask because doing this I identified the vmhost cauing th issue whereas i I connect using connct-viserver <fqdn-vmhotname> and the get-vm worked fine.

(Initially I ran get-vm -location <clusterName> to identifyy which cluser had the issue - t narrw down the number f hosts I had to individually query.)

anyway- we seem to have our PowerCli cmdlets woking right now - I will keep an eye on ti thread and hopefully can help shed some ight onto whats happennng soon. Separately we had a VMware consultant on site on Friday, I ran this scenario past him but he was unaware of similar reported behaviour from other customers.........

Stu.

0 Kudos
Munster
Contributor
Contributor

I'm also experiencing the same issue. We have about 8 clusters and I went through each one running " get-vm -location 'clustername' " one at a time and confirmed which cluster was the one experiencing problems. After that I went through each of the hosts and ran " get-vmhost 'hostname' | get-vm " and they all appeared with the same error. The only thing I can think of is a couple of weeks ago we upgraded VC and I've got a sneaky suspicion it could be related to that...... Anyone else experiencing this ??? Please help as get-vm is one of my most used cmdlets.

0 Kudos
VMuser0123
Contributor
Contributor

I had the same problem here. By following the instructions in this thread I was able to determine which host was causing the issue by running

" get-vm -location <clustername> " on each cluster, and then " get-vm -location <hostname> " on each host in the cluster until I saw the one that returned the "unable to read data fromt the transport connection" message.

Once I had determined the one host that was causing the problems, I opened a ticket with VMware and the support tech's only recommendation was to remove and re-add the host to the cluster. It so happened that we were scheduled to patch this host the next day. The host was rebooted as part of the patching and that fixed the issue. We did not have to remove and re-add the host to the cluster.

This has happened to me twice so far (the first time the problem seemed to go away on it's own after a week), once when we upgraded our VC server to vSphere, and once when we implemented "vCenter requires verified host SSL certificates" . In both of these cases, all the hosts had to be added back to vCenter after the change, so my theory is that this problem can occur when a host is added to vCenter.

0 Kudos
dalo
Hot Shot
Hot Shot

I had the same problem. After identifying the host, it was enough to disconnect and connect the host again. There was no need to remove the host from the cluster.

Daniel

0 Kudos