VMware Cloud Community
kurth83
Contributor
Contributor

Issuing esx commands from vcenter?

I am a developer working for a storage provider, we have a plugin for vcenter and want to do some health checks on the ESX hosts from the plugin.

Is there a way I can do things like vmkping and so on from the vcenter context?

I know the VSAN plugin does things like this, but it is provided by VMware and may have access to things us 3rd party developers don't.

Reply
0 Kudos
5 Replies
NathanosBlightc
Commander
Commander

Hi

If I understood you correctly, you can run any ESXi command-line with VMware PowerCLI that is connected to a vCenter server inside your vSphere environment.

Please mark my comment as the Correct Answer if this solution resolved your problem
Reply
0 Kudos
Alex_Romeo
Leadership
Leadership

Hi,

try to check if these could be right for you:

ARomeo

Blog: https://www.aleadmin.it/
Reply
0 Kudos
kurth83
Contributor
Contributor

Doesn't PowerCLI require me to have ESX credentials?  Not sure I can get them from the VCenter API.

I suspect that VC does not escrow passwords, but rather some kind of refreshable auth token.

And we would be asking customers to install PowerCLI on all of their vcenters, yes?

Reply
0 Kudos
kurth83
Contributor
Contributor

Investigating VMware doc a bit, installing powercli on vcenters is not uncommon, and required for some VMware products (Configuration Manager for example).

So how do I get to the auth token?

I guess I'll try the powerCLi forum too.

Reply
0 Kudos
LucD
Leadership
Leadership

When you are connected to the vCenter, you can use the esxcli commands via the Get-EsxCli cmdlet.

This will work for all ESXi nodes added to that vCenter, and without needing to provide ESXi credentials.

You will need to provide credentials to connect to the vCenter with the Connect-VIServer cmdlet.

Btw, installing PowerCLI on a vCenter is not advisable.

I know this was possible with the vCenter on Windows, but with the VCSA that will, in any case, be nearly impossible.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos