Automation

 View Only
  • 1.  script do see if server is startet

    Posted Mar 11, 2009 02:08 PM

    Hi

    How can I see if a guestOS is up and running through infrastructure client? either as a powershell cmd-let or vbs script.

    I know how do to it in the old GSX and vmware server, but not on ESX.

    Thanks

    Kim



  • 2.  RE: script do see if server is startet

    Posted Mar 11, 2009 02:41 PM

    $vcserver="MyServer"

    connect-VIServer $vcserver

    $vms = Get-VM -Location $cluster | Where {$_.PowerState -eq "PoweredOn"}

    Write-Host "Powered on: " $vms



  • 3.  RE: script do see if server is startet

    Posted Mar 11, 2009 02:46 PM

    Thanks for fast reply.

    But how do I wait for it?

    i have a script that start a guest and it have to wait till the guestOS is up and running before it continues.

    Sorry, but I'm a newbie in powershell

    Kim



  • 4.  RE: script do see if server is startet
    Best Answer

    Posted Mar 11, 2009 03:02 PM

    Do you have the VMware Tools installed on each guest ? And are they up-to-date ?

    If yes, this could be used as an indication if the guestOS is up and running

    $vm = Get-VM <VM-name> | Get-View
    if ($vm.Summary.Guest.ToolsStatus -eq "toolsOK"){
      Write-Host "GuestOS running"
    }
    

    If your guests only run Windows OS then you could also use the Get-WMIObject cmdlet.