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?

BenMorel
  • 4,507
  • 10
  • 57
  • 85
ixM
  • 183
  • 2
  • 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 '15 at 09: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 '15 at 10:03
  • @pauska I am not managing the hosts and have been encountering some disk performance issues on some VMs. I'd like to confirm that it's only affecting a particular host before I contact anybody. – ixM Apr 21 '15 at 10:25
  • 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 '15 at 14:55
  • @joeqwerty it's not that type of situation. I don't want to elaborate but it's not a client/support type of situation and, because of bad dynamics with the other party, I can't ask them or find an alternative. Can't "report" the problem to anyone really. I understand context is important but I'd like to have an answer (even if the answer is "not possible") to my technical question regardless of the particular business context :) – ixM Apr 21 '15 at 18:47
  • @ixM have you found any way to check that? – Bruno Bieri Oct 14 '16 at 06:14
  • @Bruno Bieri Sadly not... – ixM Oct 14 '16 at 12:08
  • 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 '17 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 '19 at 08:27

2 Answers2

0

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"

saurabh
  • 56
  • 2
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.