LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices

Reply
 
Search this Thread
Old 03-16-2011, 04:27 PM   #1
LQParsons
LQ Newbie
 
Registered: Feb 2010
Location: North of Boston, Mass (North Shore/Cape Ann)
Distribution: CentOS 6.0
Posts: 21

Rep: Reputation: 0
Question XEN VM Can you tell which is your host machine


Hi.
We're using the VMs of XEN (SuSE Linux) to run system critical processes, and further redundancy by having XEN on another machine. We boot the VMs over NFS so they are identical. We run one or the other.

Is there anyway, within a VM, to find out your host machine ?

As our VMs have their names in our DNS, with identical IPs, one connects via IP or NAME; it'd be interesting to be able to tell which of the parent hosts you are situated.

Thanks.
-doug
 
Old 03-26-2011, 12:04 PM   #2
LQParsons
LQ Newbie
 
Registered: Feb 2010
Location: North of Boston, Mass (North Shore/Cape Ann)
Distribution: CentOS 6.0
Posts: 21

Original Poster
Rep: Reputation: 0
If I'm logged onto a machine,

Question #1
How can I tell if it's a Xen/VM ?

Question #2
If so, how do I determine the host on which it is running ?

Thanks.
-doug

(I'm fully prepared to receive some basic information, as I have as yet never traipsed down this primrose path. <.grin>)
 
Old 03-26-2011, 06:18 PM   #3
Slax-Dude
Member
 
Registered: Mar 2006
Location: Valadares, Portugal
Distribution: Slackware
Posts: 240

Rep: Reputation: 62
You can easily do this if you use libvirt to manage xen, by either querying each host with virsh or using the php API and build a status page you can access.
The virsh approach is the most useful for script automation, of course.
 
Old 03-27-2011, 12:41 PM   #4
tommylovell
Member
 
Registered: Nov 2005
Distribution: Fedora, Redhat
Posts: 372

Rep: Reputation: 101Reputation: 101
Quote:
Question #1
How can I tell if it's a Xen/VM ?
Look at 'model name' in /proc/cpuinfo. I think that often shows a virtual cpu of some sort.

Last edited by tommylovell; 03-27-2011 at 12:48 PM.
 
Old 03-27-2011, 05:43 PM   #5
LQParsons
LQ Newbie
 
Registered: Feb 2010
Location: North of Boston, Mass (North Shore/Cape Ann)
Distribution: CentOS 6.0
Posts: 21

Original Poster
Rep: Reputation: 0
Hi Thanks.
$ virsh
looks interesting, its help says it's similar to
$ xm
as a tool to manage the VM running beneath.
I've been using xm as I tend to avoid GUI -- just a personal preference.

My question, however, is from the bottom looking up.

Not too long ago, one of my VMs wouldn't boot, got caught in an FSCK repair loop. Since the disks are virtual, the answer was to reboot the mother machine, do the FSCK-repair on the real disk, then all the VMs were restarted and were fine.

That got me thinking, say I have a VM, let's call it vm-foobar
which can be running under XEN on some number of machines: Moe, Larry, Curly.

(As we have many architectures {some more decrepit than others} in our heterogeneous shop, we're thinking of using VMs to better enable moving important functions from one machine to another for any disaster or maintenance.)

So when I get onto my VM, say
$ ssh fubar@foobar.test.lab
is there a way I can determine which host: (Moe, Larry, or Curly) I'm running on?

virsh doesn't run in the VM, it's only available on the mother ship.
/proc/cpuinfo gives me good information, just not what I'm looking for.

Thanks to all for all help received thus far.

-Doug.
 
Old 03-27-2011, 05:47 PM   #6
Slax-Dude
Member
 
Registered: Mar 2006
Location: Valadares, Portugal
Distribution: Slackware
Posts: 240

Rep: Reputation: 62
Quote:
Originally Posted by LQParsons View Post
virsh doesn't run in the VM, it's only available on the mother ship.
It will if you install it there
 
  


Reply

Tags
opensuse, vmware


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
file sharing between a virtual machine and the host machine okok Linux - Networking 3 06-21-2013 12:42 AM
xen virtualization host issues ramprakash Linux - Server 1 09-03-2009 07:55 PM
How to configure the serial port of my virtual machine with host machine. akram Linux - Newbie 4 07-31-2009 10:39 PM
How to see the IP of xen virtual machine from the mother machine lakshmi4linux Linux - Newbie 3 04-29-2009 03:27 AM
Xen - is there a clipboard available between guest and host? alizard Linux - General 0 10-18-2006 12:11 AM


All times are GMT -5. The time now is 07:00 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration