VMware Cloud Community
daphnissov
Immortal
Immortal

Community input request: PowerCLI commands to test vCenter availability

This will be a somewhat strange request. Basically, I'm looking to build a PS script built around PowerCLI designed to test, programmatically, and determine the "availability" and health of vCenter server. So essentially, which queries do users think represent a good "test" to see if vCenter is actually working? The commands run should represent actual queries against a system and not simply if services are started or are "green" (healthy). The catch here is that vCenter will be tested from a clone in an environment where it does not have network connectivity to any of its hosts or other resources other than a PSC (if external).

My thoughts so far are the following workflow:

  1. Connect to vCenter
  2. Get count of number of VMs
  3. Get count of number of tags (tests PSC functionality)
  4. Get count of storage policies (tests SPS)

I welcome any user input as to additional or replacement commands that could be run that indicates if vCenter is functional.

EDIT:  Just to be clear, I'm not soliciting any PowerShell, just a test methodology and an explanation of its usefulness in any steps.

Message was edited by: Chip Zoller

Reply
0 Kudos
2 Replies
AdrianTT
Enthusiast
Enthusiast

Hi,

Overall I think the transactional tests listed are sound; just wanted to share if your looking at vSphere 6.5 VCSA William Lam written some really useful functions for retrieving the Health States; PowerCLI-Example-Scripts/VAMI.psm1 at master · lamw/PowerCLI-Example-Scripts · GitHub that might be useful in development.

Kind regards,

Adrian

Please consider marking this answer "correct" or "helpful" if you think your query have been answered correctly. Cheers,
Reply
0 Kudos
daphnissov
Immortal
Immortal

Yes,I'm aware of these, however I didn't want to incorporate them for two reasons:

  1. The VAMI API is only applicable to 6.5, and I want to try and maintain backwards compatibility to v5.5 if I can.
  2. This goes back to my first point about checking service status whereas I want to adopt a methodology that is along the lines of "don't say you're healthy; prove it."
Reply
0 Kudos