Highlighted
Expert
Expert

Restart Management Agents + ESXi

Jump to solution

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

0 Kudos
1 Solution

Accepted Solutions
Highlighted
User Moderator
User Moderator

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

0 Kudos
13 Replies
Highlighted
VMware Employee
VMware Employee

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
0 Kudos
Highlighted
Community Manager
Community Manager

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".

Highlighted
Expert
Expert

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.

0 Kudos
Highlighted
User Moderator
User Moderator

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

Highlighted
Expert
Expert

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

0 Kudos
Highlighted
Community Manager
Community Manager

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".

0 Kudos
Highlighted
User Moderator
User Moderator

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

____________

Blog: LucD notes

Twitter: lucd22


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

0 Kudos
Highlighted
User Moderator
User Moderator

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

0 Kudos
Highlighted
Expert
Expert

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

0 Kudos
Highlighted
User Moderator
User Moderator

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
0 Kudos
Highlighted
Expert
Expert

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

0 Kudos
Highlighted
Expert
Expert

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.

0 Kudos
Highlighted
Expert
Expert

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

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

0 Kudos