Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

I have a monitor that is running on all guests, Windows and Linux. I'd like to send back the Parent host of the guest with this monitor, How can I found out the VM host from within a ESXi VM?

Ideally I'm looking for a universal way to do this from both Windows and Linux, but if they are separate paths that okay. Using something from VMWare tools would be fine, but I'm not currently using anything running the vSphere API.

share|improve this question

marked as duplicate by Mark Henderson Jun 12 '14 at 1:44

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

When I see people ask this type of question, I think it's fair to ask about your end goal. What do you wish to accomplish with this information? The solution hinges a bit on whether this is a real cluster, whether DRS is in the picture, where you're querying from, etc. Can you fill in some of those details? Personally, I'd be using vCenter or it's API for this. – ewwhite Jun 11 '14 at 15:04
So, why would you be gathering this info from within the guest, rather than getting the info from VSphere? Still echoing Ed :-) – mfinni Jun 11 '14 at 15:11
VCenter API. Extract VM location from your vCenter on demand. It's totally scriptable. I'd add it to my answer... But. – ewwhite Jun 11 '14 at 15:12
@KyleBrandt Your question as posted is short on details that would indicate what research has been done, what methods you've already tried that didn't work, or any troubleshooting steps. Frankly, if this were coming from a low-rep account, I think it would already have a close vote or two. – Magellan Jun 11 '14 at 15:55
Seriously? Closing this as off topic, even though this question is actually already answered elsewhere on the site? I think some of you are taking these close reasons way too liberally. – Mark Henderson Jun 12 '14 at 1:44

It seems like, out of the box, you cannot. You can however set a custom variable in VSphere to start tracking this info, and then query it using the vmtools in the guest.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.