VMware Cloud Community
bansne
Enthusiast
Enthusiast

PowerCli Script to restart vSAN mgmt and vpd services on all ESXi in VC

Hi,

I need help to create powercli script to run following services on all ESXi in VC. I need to restart the services on all ESXi in VC. LucD

I have 7 Clusters and approx. 30 ESXi hosts. I checked couldn't find a way to stop and start these on all esxi .

"/etc/init.d/vsanmgtd"

"/etc/init.d/vsanvpd"

If it is possible to get any command which I can run from "rvc" under vc for all clusters would also be helpful.

Reply
0 Kudos
8 Replies
bansne
Enthusiast
Enthusiast

LucD​ Would you be able to provide some help in this matter.

Reply
0 Kudos
LucD
Leadership
Leadership

Can you have SSH access to the ESXi nodes?


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

Reply
0 Kudos
bansne
Enthusiast
Enthusiast

Hi,

Yes I do have access to ssh.

Password is not same on all ESXi .

Reply
0 Kudos
LucD
Leadership
Leadership

Ouch, can you retrieve those passwords in a secure way in a script?


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

Reply
0 Kudos
bansne
Enthusiast
Enthusiast

I have export of all esxi passwords

Reply
0 Kudos
LucD
Leadership
Leadership

In that case, I would loop through the list and connect to all the ESXi nodes with SSH through through the cmdlets in the Posh-SSH module.

Once connected, you can launch the restart commands.

Would that work?


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

Reply
0 Kudos
bansne
Enthusiast
Enthusiast

Hi,

I have no internet access to download it on client server. Is there any other way by which I can restart services .Stop or start at one like we do for ssh.

Reply
0 Kudos
LucD
Leadership
Leadership

I'm afraid not, the Get-VMHostService cmdlet only exposes a limited set of services.

You can do a Save-Module on a station that has Internet access.

Then copy the downloaded files to one of the Modules folders on the target station.


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

Reply
0 Kudos