|
This article describes how to manage a standard XEN environment on Fedora 8. It explains how to power on/off a virtual xen machine, how to open a console and some basics about performance monitoring. virt-manager - The GUIThere is a very basic GUI available. It is called virt-manager and it is pretty much self explaining. You can start it with the command "virt-manager". If you are in a remote shell (ssh) don't forget to set the DISPLAY variable to your workstation. [root@localhost ~]# virt-manager
 Now you have to connect to the XEN hypervisor. This can be done either by double clicking it or file-->connect...  The GUI is more or less self explaining and really easy to use. However, I definitely recommend to use command line tools such as "xm" or "virsh" xm - the XEN management user interface "xm" is (almost) the only command you need to manage your virtual servers. With xm you can power on/off a vm or open a console, add more memory and do other stuff like that. It is part of the XEN rpm, so you don't have to install any additional package. xm list List information about all/some domains. With "xm list" you can see which virtual machine is currently running and some information about how much cpu and memory they use at the moment.
[root@localhost ~]# xm list Name ID Mem VCPUs State Time(s) Domain-0 0 2392 1 r----- 547.8 mydns 256 1 35.4 myguest 256 1 0.0 myweb 256 1 34.1 [root@localhost ~]#
As you can see, the only domain which is currently running is domain-0. Domain-0 is our host system which is installed on "real" physical hardware. xm start, shutdown, destroy The command to power on the virtual server "myguest" is "xm start myguest". To shutdown the virtual machine the command is "xm shutdown myguest": [root@localhost ~]# xm start myguest [root@localhost ~]# xm list Name ID Mem VCPUs State Time(s) Domain-0 0 2264 1 r----- 170.0 mydns 256 1 35.4 myguest 2 256 1 ------ 8.0 myweb 256 1 0.0 [root@localhost ~]# xm shutdown myguest [root@localhost ~]# xm list Name ID Mem VCPUs State Time(s) Domain-0 0 2264 1 r----- 554.8 mydns 256 1 35.4 myguest 256 1 26.4 myweb 256 1 0.0
To power off the virtual machine immediately you can use "xm destroy myguest". This is like unplugging the power cord --> BE CAREFULL!!! [root@localhost ~]# xm destroy myguest
xm console I always open a console to the virtual machin after starting it. The command for this is "xm console myguest" [root@localhost ~]# xm console myguest
Now you should see the login prompt of the console: Starting HAL daemon: [ OK ] Starting anacron: [ OK ]
Fedora release 8 (Werewolf) Kernel 2.6.21-2950.fc8xen on an i686
localhost.localdomain login:
To exit a console type "CTRL -]" Performance monitoring xentopxentop displays real-time information about the Xen system and domains. It looks similar to the Linux tool "top" and I think there is also a tool like that for vmware esx.
I always change the delay from 3 seconds (default) to 1 second by pressing d + 1 + enter on the keyboard.
|