VMware Cloud Community
RobMokkink
Expert
Expert
Jump to solution

Restart Management Agents + ESXi

Is there a way to Restart the Management Agents in ESXi from a cmd-let or SDK method?

Reply
0 Kudos
1 Solution

Accepted Solutions
RvdNieuwendijk
Leadership
Leadership
Jump to solution

Afaik the vmware-vpxa service is the VMware vCenter Agent. The management agents are the mgmt-vmware service which you can't restart (yet) with PowerCLI.

Regards, Robert

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition

View solution in original post

Reply
0 Kudos
13 Replies
MauroBonder
VMware Employee
VMware Employee
Jump to solution

you can access whith SSH and run services.sh restart

Enabling SSH www.vm-help.com/esx/esx3i/ESXi_enable_SSH.php

if you preffer a basic method http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=100349...

*If you found this information useful, please consider awarding points for "Correct" or "Helpful"*

*Please, don't forget the awarding points for "helpful" and/or "correct" answers. *Por favor, não esqueça de atribuir os pontos se a resposta foi útil ou resolveu o problema.* Thank you/Obrigado
Reply
0 Kudos
lamw
Community Manager
Community Manager
Jump to solution

No, the question was using the APIs/SDKs and the answer to that is yes there is a way and should be the method unless it does not work, then you would use TSM

I wrote a blog post using vSphere SDK for Perl script - http://www.virtuallyghetto.com/2010/07/new-way-of-enabling-and-disabling.html but I'm sure there is a PowerCLI cmdlet to do exactly the same.

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

William Lam

VMware vExpert 2009,2010

VMware scripts and resources at:

Twitter: @lamw

Getting Started with the vMA (tips/tricks)

Getting Started with the vSphere SDK for Perl

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

If you find this information useful, please award points for "correct" or "helpful".

RobMokkink
Expert
Expert
Jump to solution

I know how to restart the services available on ESX and ESXi through powershell. But i would like to know how to "Restart Management Agents", this option available only from the console.

I don't see the management agenst inside the services on ESXi. I need to do this, because i am replacing the certificates during my postinstallation.

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Hi Rob,

Isn't that just

Get-vmhost <hostname> | Get-VMHostService | where {$_.Key -eq "vmware-vpxa"} | Restart-VMHostService -Confirm:$false

____________

Blog: LucD notes

Twitter: lucd22


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

RobMokkink
Expert
Expert
Jump to solution

Hi Luc,

Is it that service? I will test it tomorrow.

The ESXi servers are not add to vCenter when i replace the certificates.

If it works i go for the next challenge, that is enableling the Authentication Services

Reply
0 Kudos
lamw
Community Manager
Community Manager
Jump to solution

Yes, it is a service that can be controlled, this is also mentioned in my blog post.

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

William Lam

VMware vExpert 2009,2010

VMware scripts and resources at:

Twitter: @lamw

Getting Started with the vMA (tips/tricks)

Getting Started with the vSphere SDK for Perl

VMware Code Central - Scripts/Sample code for Developers and Administrators

VMware Developer Community

If you find this information useful, please award points for "correct" or "helpful".

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Yes, see also the screenshot on William's blog post.

____________

Blog: LucD notes

Twitter: lucd22


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

Reply
0 Kudos
RvdNieuwendijk
Leadership
Leadership
Jump to solution

Afaik the vmware-vpxa service is the VMware vCenter Agent. The management agents are the mgmt-vmware service which you can't restart (yet) with PowerCLI.

Regards, Robert

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
Reply
0 Kudos
RobMokkink
Expert
Expert
Jump to solution

I think, i will just reboot the server and wait until it's back.

Reply
0 Kudos
RvdNieuwendijk
Leadership
Leadership
Jump to solution

Restarting the ESXi server is a way to restart the management agents you can do from PowerCLI Smiley Wink.

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
Reply
0 Kudos
RobMokkink
Expert
Expert
Jump to solution

I think it is a nice feature request to make it available through the API.

Reply
0 Kudos
RobMokkink
Expert
Expert
Jump to solution

I had a brainwave this morning. I can upload the new certificates through:

http://poshcode.org/624

I can enable the SSH service, execute /sbin/services.sh restart.

The login backup in with connect-viserver and disable ssh. It may be quick and dirty, but it saves me a reboot.

Reply
0 Kudos
RobMokkink
Expert
Expert
Jump to solution

Got it all working now. Also took a look at this script:

http://communities.vmware.com/docs/DOC-817

Reply
0 Kudos