Thursday, October 13, 2011

Working With XEN Virtualization

Recently I faced to a situation of loggin in to a Xen server and managing the domains of it. Our SVN version control system and a lot more runs on a linux server which is not actually running on real hardware. It runs on another linux operating system with the Xen virtualization. Our SVN recently got stuck due to lack of memory provided by the Xen virtual machine for it. This is where I have been asked to fix it by logging in to our main server where all these Xen virtualizations runs.

In simple terms, Xen is a virtual machine monitor for X86 architecture. You can install it on top of a linux operating system and then more guest operating systems can be installed on this host operating system to be run simultaneously on the host operating system. Xen provides tools to manage these guest operating systems. Xen is an open source software with GNU general public license.

Xen is very useful to utilize the actual hardware resources we have at the bottom level. As an example we have several servers with different public IPs running on the same computer under Xen virtualization. I think there may be so many advantages of Xen virtualization like security on the virtualized guest systems. However I know very few things about it because I just came through it very recently. There are so many things that I have learnt by experience rather by a formal method. This is another one of that experience list.

Since I'm not the guy who installed Xen on our main server, I have no proper knowledge about how to install and do the initial things with it. What had to do is to log into the main server and do different things with the currently running Xen virtualization. Xen provides a nice command called 'xm' which it the command that we use to do most of the things with the Xen server.

First I log in to the main server remotely using secure socket layer.


(these x values are representing the servers IP address)

After entering the password correctly I'm in. Then I can look at the current domains or the guest systems running on this main server. They can be listed by running this command.

    xm list

Each domain has a name. These domains are created by using configuration files that are resides in /etc/xen directory. Each configuration file name ends with the extension '.cfg'. Those configuration files can be used to create domains. Content of the configuration files can be viewed by openning them using the VI editer. The path to the kernel of the guest operating system, the mount of memory assigned to it, name of the domain are few of the information that is written in the configuration files.

The below command can be used to reboot a current domain which was listed by the previous command.

    xm reboot domain_name

You can destroy a current domain by issuing the following command.

    xm destroy domain_name

When you want to create a destroyed domain again with the help of available configuration file of it, you can do it with the follwing command.

    xm create -c configuration_file_name.cfg

This create command may take some time to complete.

These are the things that I've learnt unexpectedly. I know that I should read more about the Xen servers to have a more complete understanding about how the installation and configuration stuff is carried on. I will do it in the future. This is for now.

No comments:

Post a Comment