Automation

 View Only
Expand all | Collapse all

Restart Management Agents + ESXi

  • 1.  Restart Management Agents + ESXi

    Posted Jul 21, 2010 05:07 PM

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



  • 2.  RE: Restart Management Agents + ESXi

    Broadcom Employee
    Posted Jul 21, 2010 05:13 PM

    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=1003490

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



  • 3.  RE: Restart Management Agents + ESXi

    Broadcom Employee
    Posted Jul 21, 2010 05:18 PM

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



  • 4.  RE: Restart Management Agents + ESXi

    Posted Jul 21, 2010 05:28 PM

    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.



  • 5.  RE: Restart Management Agents + ESXi

    Posted Jul 21, 2010 05:54 PM

    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



  • 6.  RE: Restart Management Agents + ESXi

    Posted Jul 21, 2010 06:07 PM

    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



  • 7.  RE: Restart Management Agents + ESXi

    Broadcom Employee
    Posted Jul 21, 2010 06:10 PM

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



  • 8.  RE: Restart Management Agents + ESXi

    Posted Jul 21, 2010 06:12 PM

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

    ____________

    Blog: LucD notes

    Twitter: lucd22



  • 9.  RE: Restart Management Agents + ESXi
    Best Answer

    Posted Jul 21, 2010 06:13 PM

    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



  • 10.  RE: Restart Management Agents + ESXi

    Posted Jul 21, 2010 06:16 PM

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



  • 11.  RE: Restart Management Agents + ESXi

    Posted Jul 21, 2010 06:30 PM

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



  • 12.  RE: Restart Management Agents + ESXi

    Posted Jul 21, 2010 07:25 PM

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



  • 13.  RE: Restart Management Agents + ESXi

    Posted Jul 22, 2010 06:14 AM

    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.



  • 14.  RE: Restart Management Agents + ESXi

    Posted Jul 22, 2010 07:45 AM

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

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