Runtime Configuration


Now that your guest OS is up and running, you can start trying out more of the features of the xm command on dom0. You have already seen xm mem-set, which alters the amount of memory allocated to a machine. This works because the domU VM is aware of its virtualized state and can therefore handle having memory taken away. This extends further: You can use xm shutdown yourvm to have Xen politely request the VM to shutdown. On Linux, this goes through the whole shutdown sequence properly, ensuring that the machine is cleanly terminated. If you want an immediate shutdown, use xm destroy yourvm (warning: data might be lost).

The xm command can also be used to save snapshots of a virtual machine, rather than just switching them off. To do this, use xm save yourvm yourvm.state. That command essentially saves the RAM of the yourvm VM (change yourvm to whatever you called your virtual machine) to a file, and then turns off the VM. To restore a saved state, just use xm restore yourvm.state. If you want to create a virtual machine from a configuration file, use xm create -c yourconfig. Note that Xen searches the directory /etc/xen for configuration files, and that each VM must have a unique name assigned to it and set in the configuration file.

You can connect to the console of any virtual machine by running xm console yourvm. To exit from a console, press Ctrl+] (Control + right bracket). This does not shut down the VM; the VM continues to run, but you are no longer connected to it and have to use xm connect to reconnect.

Tip

The configuration files in /etc/xen are in text format and so are easily edited. For example, if you want to change the number of CPUs a VM sees, look for the vcpus setting. Note that these are virtual CPUs rather than real onesyou can set this to 8 and have your guest see eight CPUs, even if your actual machine has just one. This is a great way to test a cluster without going beyond your desktop!


Related Fedora and Xen Commands

The following commands are useful for working with Xen on Fedora:

vncviewer Lets you connect to the graphical output of a Xen VM

xend Starts and stops the Xen daemon without using the service command

xenguest-install.py A helpful script that generates configuration files for you

xm Lets you manipulate the state of virtual machines while they are running




Red Hat Fedora 5 Unleashed
Red Hat Fedora 5 Unleashed
ISBN: 067232847X
EAN: 2147483647
Year: 2004
Pages: 362

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net