How to identify host , datastore and vCenter of the running VM .

when vCenter\PSC is running as the appliance on the  host configured in the same vCenter and in case of  the VM (vCenter\PSC)  failure, we need information about the VM running on which host,datastore to bring it back online.

Also in another situation where in VR vSphere Replication with or without SRM ,vCenter is the key factor to restore the VMs and in that scenario we need to know the datastore in which VCenter is running.

  1. To check the VM running on which datastore.

Login to the powercli and connect to any  ESXi in cluster.

Connect-VIServer ESXiIP

PowerCLI C:\> dir -Recurse -Path vmstores:\ -Include VM NAME AS IN INVENTORY | Select-Object Datastore

vmd

If the ESX is having lot of datastores connected then we can try the below steps.

Login to the ESX SSH

cd  /VMFS/Volumes/

find / -name “vmname.vmx”

In case the result comes with the UID name of the datastroe , instead of name of the datastore then use the below command to find the datastore name.

/vmfs/volumes # find / -name “vm.vmx”
/vmfs/volumes/4906d6-3c160c98/vm/vm.vmx

/vmfs/volumes # esxcli storage filesystem list | grep 4906d6-3 ( it will show the datastore name )

2. To check the VM running on which host.

Login to ssh of any host running on the cluster.

cd /vmfs/volumes/datastore in which VM is running

Look for the latest vmware.log file

cat vmware.log | grep Hostname ( case sensitive )

It will show the hostname.

ped

3. To check the vCenter the VM belongs .

In huge environment with more number of vCenter across the environment in some situation we need to know which vCenter the VM is running from the guest system.I was searching this in google and found good article which explains the steps.

Read the article for full details and I will show the steps involved .

Right click and edit the VM to check the MAC Address or type ipconfig /all from the guest VM CMD.

 

q2

vCenter Server instance ID” is used for generating virtual machine MAC addresses and MAC address is well known digital identifier which can be relatively simply identified in any operating system.  So what this “vCenter Server instance ID” is? Each vCenter Server system has a vCenter Server instance ID. This ID is a number between 0 and 63 which is randomly generated at installation time, but can be reconfigured after installation. Here in vSphere 6.0 documentation is written that … According to this scheme, a MAC address has the following format:

00:50:56:XX:YY:ZZ
where 00:50:56 represents the VMware OUI,
XX is calculated as (80 + vCenter Server Instance ID),
and YY:ZZ is a random number.

 

Note 1:

The formula above (80 + vCenter Server Instance ID) is in hexadecimal format therefore in decimal format it is 128 + vCenter Server Instance ID.

use the script mentioned in the article or other websites there to help to convert.

sed

f3d

Note 2:

vCenter Server unique ID is generated randomly during vCenter installation. It can be changed after installation in the Runtime Settings section from the General settings of the vCenter Server instance and restart it. Please be aware, that existing Virtual Machines MAC addresses are not changed automatically after ID reconfiguration therefore it is good idea to change vCenter Server unique ID immediately after vCenter Server installation. There are methods how to regenerate VM mac addresses but it requires VM downtime. For more information look at VMware KB 1024025

153-128 = 25

rq2

There are some caveats on this method check the link below for more info.

4. Check my other blog to see which VMDK is associated with which disk in Windows Server.

How to find which VMDK is associated with which disk in Windows Server.

Reference :

http://blog.igics.com/2016/02/how-to-identify-from-guest-os-on-which.html?m=1

Advertisements
This entry was posted in ESX command, PowerCLI, VMware, vSphere Replication VR and tagged , , , . Bookmark the permalink.

One Response to How to identify host , datastore and vCenter of the running VM .

  1. Pingback: How to find which VMDK is associated with which disk in Windows Server. | Techbrainblog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s