Xen Project Q&A Forum: First Line Help for Simple Questions

This is your chance to ask questions and provide answers about basic use of the Xen Project software. For debugging problems and for more complex issues, consider using the xen-users mailing list instead. You can find information about xen-users under "HELP | Mailing Lists" in the navigation bar above.

Im looking for the commands that can be executed to fetch the OS Version of the VMs running on the below Hypervisors.

Xen (Not the citrix Xen server, but the Xen Sever hosted on a ubuntu Machine)
Responses (1)
  • Accepted Answer

    Monday, July 21 2014, 01:22 PM - #permalink

    For Xen Project, the hypervisor itself does not know what version of what distribution is used in a guest, so there isn't a Xen Project-specific command to do this. That said, there are multiple ways to attack the problem.

    One common practice used by some people is to include the base info in the Domain name, e.g., "LAMP-ubuntu-14_04" or something like that. It requires the manager of that VM to have the foresight to adhere to a naming convention, but it is one way of addressing the issue.

    When you have an image which does not conform to such a naming convention, you answer the question the same way you'd answer it for any machine with an unknown operating system version. The tricky parts are (1) identifying the type of OS (e.g., Linux, *BSD, Windows), and (2) customizing the OS query method to that OS type.

    In the Linux world, executing the command "cat /etc/*-release" can be profitable. If that fails, "cat /etc/issue*" can sometimes be used (but the first command is to be preferred). The command can be executed via ssh in a script file (assuming ssh is configured to allow same), or you could use an interactive script (using a scripting language like "expect") to get it from the "xl console" interface. If you are only interested in the version under Domain 0, then you can simply execute the command in a Domain 0 command shell.

    SSH example:

    ssh user@ipaddress "cat /etc/issue*"

    gives output on many Linux systems which can be fed into a script or file.

    For Windows and *BSD, I'd Google for articles for the best way to identify these guests. Once again, you need to use the generic methods available rather than something specific to the hypervisor.

    I don't know if XenServer/XCP has some special way to answer this question. For that, I'd take a look in the support channels described over at XenServer.org. All the XenServer-specific (as opposed to Xen Project, which is the foundation which XenServer builds upon) issues can be addressed over there.

    The reply is currently minimized Show
Your Reply