Notes on Xen

Management commands

The 'xm' command is the main one you need to know about. It seems the main gateway through which you accomplish things in Xen. 'xentop' is actually an alias to this.
  • xm console is useful. It lets you view the virtual console of the machine. The useful hotkey here is ctrl-], which is the same hotkey you use to break to a prompt in the telnet command. Here, it breaks the console session without you having to kill the process elsewhere.
  • xm list will show you a list of all currently running domains.

Useful concepts to understand

When Xen says 'destroy', in its settings, that doesn't mean the death of the VM. All that destruction means is that the VM is 'shut down'.

Setting the Config Files

Host configs/settings tend to live under /etc/xen, and if you want it to start up on boot you must place the config file under /etc/xen/auto.
  • If you wish for the host's interface to be on the same network as the parent machine, one would use 'bridge=xenbr0' instead of 'virbr0'.
  • The config files are generally created via the command 'virt-install'. An example from my own system is below. I would suggest deciding upon a MAC address before this, if you wish to ultimately control everything via dhcp.
    • virt-install --name mail --disk path=/dev/XenVG/mail_main -r 1024 --location --extra-args="ks="
    • Have had better luck of late with: /usr/sbin/virt-install --name anon --disk path=/dev/XenVG/anon_main --r 256 --location --extra-args=ks= ip= gateway= netmask= text - please note the hard-coding of IP to get around not having a DHCP server in the colo.

Getting the IPs you want

  • First, see the bit above about the bridge if your host is grabbing IPs on the 192.168.122 network and you don't like that.
  • Next, if you're on a CentOS machine, chances are that it will have decided to use dnsmasq instead of dhcpd. It's not terribly hard to use, just different.

-- SeanNewton - 27 Mar 2011

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2012-01-17 - SeanNewton
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback