Hyper-V

Find out on which Hyper-V host the node is running

Sometimes is you using Hyper-V, you like to find out on which Hyper-V host the node is running. Here are two solutions for Linux to find the right host.

ruby

IO.binread('/var/lib/hyperv/.kvp_pool_3')[/\HostName(.*?)HostingSystemEditionId/, 1].scan(/[[:print:]]/).join

bash

strings /var/lib/hyperv/.kvp_pool_3|sed -n '/PhysicalHostNameFullyQualified/ {n;p}'

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.