Morning,
I had a problem (so far not diagnosed) in which now my vCenter is down.
The vCenter is a virtual machine.
I have over 50 hosts (don´t know all their names and IPs), all ESXi 4.1, and I´d like to know if there´s anyway I can discover in which one of them is my vCenter VM without having to log into each one of them.
You will need to access each one idvidually whether through the vSphere client or console to see what VMs are running on the host -
Hi,
Additionally if you have vMA or Powercli, it's easy to search the VMs which is running by each & every ESXi Server.
Again It can be done searching every ESXi server.
If you can dump a list of your hostnames to a txt file, this script will search for your VM.
$vmsearchname is the name of the VM you are looking for
$esxhosts points to the txt file with the host names. It should be in the format of
name
Hostname1
Hostname2
Hostname3
$rootaccess provides the root password
$vmsearchname = "vCenter5"
[array]$esxhosts = Import-Csv c:\hosts.txt
$rootaccess = Get-Credential -Credential root
foreach ($esxhost in $esxhosts) { Connect-VIServer -Server $esxhost.name -Credential $rootaccess
Get-VM | %{If ($_.name -match $vmsearchname) {Write-Host "Found $($_.name) on $($esxhost.name)"}} }
Hi Chriswahl00,
Excellent....