Difference between revisions of "Setting up a xen server"

From FreekiWiki
Jump to navigation Jump to search
(pulled docs from RT ticket)
 
(22 intermediate revisions by 5 users not shown)
Line 1: Line 1:
i've configured and played with xen on laze.
+
oh, have fun.
  
== to set create the parent server (out of date?) ==
+
== to create the parent server ==
as long as you don't read the documentation(at least, i found it very confusing and intimidating), it's actually not much more difficult than vserver.
 
  
apt-get install xen-linux-system-2.6.18-3-xen-vserver-686 xen-tools libc6-xen
+
install the freegeek-xen-server which includes some custom hooks for xen at
 +
freegeek.
  
(alternately, you could install xen-linux-system-2.6.18-3-xen-686, or xen-linux-system-2.6.18-3-xen-vserver-686)
+
apt-get install freegeek-xen-server
  
martin noticed that you likely will need to edit
+
edit /etc/xen-tools/xen-tools.conf:
  
  /etc/xen-tools/xen-tools.conf:
+
  kernel = /boot/vmlinuz-xen
 +
initrd = /boot/initrd.img-xen
 +
debootstrap = 1
 +
lvm = vg
 +
dist = etch
 +
passwd = 1
 +
mirror = http://apt.freegeek.org:9999/debian/
  
kernel = /boot/vmlinuz-2.6.18-3-xen-vserver-686
+
modify /etc/xen/xend-config.sxp:
initrd = /boot/initrd.img-2.6.18-3-xen-vserver-686
 
  
to match the kernel you have installed
+
(network-script freegeek-network-script)
  
[http://bugs.debian.org/405223]
+
;Controlling the amount of memory dom0 uses
 +
* In /boot/grub/menu.lst add to the line # xenhopt=dom0_mem=256M then run update-grub
  
i've been unable to verify if this helps at all, but:
+
== to create an instance on the parent server ==
 +
Create new xen instances with:
  
[http://lists.xensource.com/archives/html/xen-users/2006-11/msg00034.html]
+
xen-create-image --hostname SERVERNAME --ip 192.168.?.? --netmask 255.255.255.0 --gateway 192.168.?.1
  
echo 'hwcap 0 nosegneg' > /etc/ld.so.conf.d/libc6-xen.conf
+
Make sure SERVERNAME and the chosen ip address don't exist already.
  
appears to not help at all, at least on laze.
+
It will ask for a root password. Have one prepared and ready to go.
  
== to create an instance on the parent server ==
+
Your configuration file will be in:
you create new xen instances with:
+
 
 +
/etc/xen/NAME.cfg
  
xen-create-image --hostname NAME --debootstrap --mirror http://some.debian.mirror/debian --dist etch
+
Check to see that it is there.
  
(you set some default values in /etc/xen-tools/xen-tools.conf)
+
To have it start automatically:
 +
ln -s /etc/xen/NAME.cfg /etc/xen/auto/
  
you start a xen instance with:
+
To start the xen instance:
  
 
  xm create NAME.cfg
 
  xm create NAME.cfg
  
list the running xen instances and how much resources they're using:
+
To list the running xen instances and how much resources they're using:
  
 
  xm list
 
  xm list
  
to get networking to work, i had to uncomment in /etc/xen/xend-config.sxp:
+
To get to a login screen on the vm, either ssh in, or:
(network-script network-bridge)
 
 
 
and restart xend:
 
 
 
invoke-rc.d xend restart
 
 
 
reclaim memory for the host machine stolen by stopped xen instances:
 
 
 
xm mem-set Domain-0 700
 
 
 
(for 700MB of ram)
 
 
 
to get to a login screen on the vm, either ssh in, or:
 
  
 
  xm console NAME
 
  xm console NAME
  
there's some mechanism to start instances at boot time i haven't yet explored, but it doesn't sound difficult.
+
To get out of the instance, the secret keystroke is ''Ctrl-]''.
  
 +
log into the xen instance (either with ssh or xm console), and ensure the
 +
freegeek-xen-instance package is installed:
  
 +
apt-get install freegeek-xen-instance
  
[[Category:ASS]]
+
[[Category:Technocrats]]

Latest revision as of 18:12, 28 January 2012

oh, have fun.

to create the parent server

install the freegeek-xen-server which includes some custom hooks for xen at freegeek.

apt-get install freegeek-xen-server

edit /etc/xen-tools/xen-tools.conf:

kernel = /boot/vmlinuz-xen
initrd = /boot/initrd.img-xen
debootstrap = 1
lvm = vg
dist = etch
passwd = 1
mirror = http://apt.freegeek.org:9999/debian/

modify /etc/xen/xend-config.sxp:

(network-script freegeek-network-script)
Controlling the amount of memory dom0 uses
  • In /boot/grub/menu.lst add to the line # xenhopt=dom0_mem=256M then run update-grub

to create an instance on the parent server

Create new xen instances with:

xen-create-image --hostname SERVERNAME --ip 192.168.?.? --netmask 255.255.255.0 --gateway 192.168.?.1

Make sure SERVERNAME and the chosen ip address don't exist already.

It will ask for a root password. Have one prepared and ready to go.

Your configuration file will be in:

/etc/xen/NAME.cfg

Check to see that it is there.

To have it start automatically:

ln -s /etc/xen/NAME.cfg /etc/xen/auto/

To start the xen instance:

xm create NAME.cfg

To list the running xen instances and how much resources they're using:

xm list

To get to a login screen on the vm, either ssh in, or:

xm console NAME

To get out of the instance, the secret keystroke is Ctrl-].

log into the xen instance (either with ssh or xm console), and ensure the freegeek-xen-instance package is installed:

apt-get install freegeek-xen-instance