8

Is there a way to see if several Virtual Machines are running on the same host? Specifically, I have three VMWare VMs (each running a Ubuntu Server 14.04) and I have tried to compare different pieces of information:

  • dmidecode -s system-serial-number gives different results for each VM
  • lspci returns the same output for each VM
  • cat /proc/cpuinfo returns similar values for two of them and one has a completely different output (notably the "model name" line is different)

This doesn't help me to find determine which ones are running on the same host (if any).

Are there any other way to check?

9
  • 3
    In what professional setting do you need to figure this out? Does it matter where the VM's run, as long as they're up? Can't you ask the people administrating the virtualization hosts?
    – pauska
    Apr 21, 2015 at 9:44
  • 4
    @pauska actually I can imagine a few scenarios. For example for making sure all your DB replicas are not running on the same physical host, when the virtualization provider is untrusted third party ... (and yes, this s***ty politics happens in large 'professional' corporations as well)
    – Fox
    Apr 21, 2015 at 10:03
  • 1
    So you haven't contacted support to report your problem because you want to identify the problematic host first? That makes no sense to me. Why would it matter to you from a support perspective? If I have a problem with a service, I don't generally try to isolate the cause of the problem for the service provider before I call for support. That's their job. I call them and report the problem and let them do the work of finding it and resolving it.
    – joeqwerty
    Apr 21, 2015 at 14:55
  • 1
    "in what professional setting do you need to figure this out?" I have a build server that's one the physical box as my lower test environment vms (SIT)... For full builds (~1.2 Gb tar.gz) i can either transfer files over the network (~5-10 minutes) to deployment server or copy locally (<1min) and execute deploy, shaving about 10min off total run time on avg...
    – niken
    Apr 12, 2017 at 19:45
  • 1
    It's annoying to have people question the why of your question. There are plenty of reasons why you'd like to know whether 2 instances run on the same host, and I'll add one: redundancy. If you're using a load balancer with a few instances behind it for redundancy, but all these instances are on the same host, then you pretty much have zero redundancy. If the host fails, your whole infrastructure is down.
    – BenMorel
    Dec 17, 2019 at 8:27

2 Answers 2

1

If vmware tools are installed then below command can be used on both machines to verify physical host's hostname

/usr/bin/vmtoolsd --cmd "info-get guestinfo.hypervisor.hostname"

0

It's not 100%, but there are some tricks you can try with networking...

If you can trace route to each VM, then look for them all to go through the same second-to-last hop. If that's the case, there's a decent chance they're on a common host.

Try pinging from VM to VM and from VM to default gateway. If the VM-to-VM times are the same and ≤ the VM-to-defgw times, then there's a high probability that they're on the same machine. (Look at the minimum time across lots of pings for best results).

If you know more about the actual network topology from backbone -> host -> guest then you may be able to glean additional insight from network tools.

You can also try looking at the MAC addresses on the VMs for some clues.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .