VMware Cloud Community
KimCarlsen
Contributor
Contributor
Jump to solution

script do see if server is startet

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

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

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.


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

View solution in original post

Reply
0 Kudos
3 Replies
langleyj
Contributor
Contributor
Jump to solution

$vcserver="MyServer"

connect-VIServer $vcserver

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

Write-Host "Powered on: " $vms

Reply
0 Kudos
KimCarlsen
Contributor
Contributor
Jump to solution

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

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

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.


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

Reply
0 Kudos