VMware Cloud Community
StephenMoll
Expert
Expert

Damaged VMs, missing data...

I am regularly running PowerShell scripts on our systems, and the commands are often against VMs in groups, either by VMs in a particular cluster or on a particular host, so the command will often start with a "Get-Cluster" and pipe that into "Get-VM".

Today it didn't work. I was trying to get a list of VMs on a particular cluster and the command would fail:

Get-Cluster -Name "{cluster}" | Get-VM

Get-VM : {date} {time} Get-VM    Exception has been thrown by the target of an invocation.
At line:1 char:29
+ get-cluster -Name COMPUTE | Get-VM
+                                                    ~~~~~~~~
      + CategoryInfo                : NotSpecified: (:) [Get-VM], VimException
      + FullyQualifiedErrorId    : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.GetVM

After some head scratching I could fix the problem by moving a couple of VMs. These two particular VMs show up in the vSphere Webclient OK and I can do stuff with them there. In PowerCLI however, I couldn't run any commandlets where the output should include these VMs and pipe that into a following commandlet.

 

I discovered that if I do a Get-VM on them directly and pipe to "Format-List *", much of the data is missing.

For all VMs there is something in all fields except for "VApp".

These two VMs however are empty for:

Notes, Guest, VMHostID, VMHost, VApp, FolderId, Folder, ResourcePoolId, ResourcePool, VMSwapfilePolicy, Version, PersistenceId, GuestId, UsedSpaceGB, ProvisionedSpaceGB, DatastoreIdList

I think the critical thing here is that the VMHost and VMHostId values are blank for these VMs.

The VMs are working, and have recently been undergoing functional testing, which did not throw up any problems, so at a system level they work as expected. My concern is that under-the-hood we have a lot of bespoke system management software that is using the vSphere API and the PowerCLI API to manage pretty much everything, and that these VMs make cause problems.

What I would like to understand is what is it about these VMs that may be making them behave this way?

Is there something I can do to make them 'normal'? Or should they be considered broken and seek to get them redeployed?

0 Kudos
2 Replies
StephenMoll
Expert
Expert

Some other tidbits:

The two VMs in question were delivered as pre-configured virtual appliances, in OVF format.

They are also the ONLY VMs on our entire system with virtual hardware v14. Everything else is between v9 and v13.

 

Tags (1)
0 Kudos
StephenMoll
Expert
Expert

Still not sure what happened here, and haven't much opportunity to revisit that system and try again as it is being constantly used to support testing at the moment. 

The current suspicion is that the maintainers' laptop connect  to the system management network may be using an outdated version of PowerCLI.  

0 Kudos