Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 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.

2  
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 at 15:04
3  
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 at 15:11
3  
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 at 15:12
4  
@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 at 15:55
1  
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 at 1:44

1 Answer 1

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.

http://www.virtuallyghetto.com/2011/01/how-to-extract-host-information-from.html

share|improve this answer

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