Difference between revisions of "Setting up a xen server"

From FreekiWiki
Jump to navigation Jump to search
(use freegeek specific xen packages and other updates)
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 set create the parent server (out of date?) ==
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 /etc/xen-tools/xen-tools.conf:
+
symlink the kernel and initrd images, otherwise we'll have to manually update
 +
each xen instance's configuration file on upgrade:
  
  kernel = /boot/vmlinuz-2.6.18-3-xen-vserver-686
+
  ln -s /boot/vmlinuz-MOST-RECENT-VERSION /boot/vmlinuz-xen
  initrd = /boot/initrd.img-2.6.18-3-xen-vserver-686
+
  ln -s /boot/initrd.img-MOST-RECENT-VERSION /boot/initrd.img-xen
  
to match the kernel you have installed
+
edit /etc/xen-tools/xen-tools.conf:
  
[http://bugs.debian.org/405223]
+
kernel = /boot/vmlinuz-xen
 +
initrd = /boot/initrd.img-xen
 +
debootstrap = 1
 +
lvm = vg
 +
dist = etch
 +
passwd = 1
 +
mirror = http://mirrors.kernel.org/debian/
  
i've been unable to verify if this helps at all, but:
+
modify /etc/xen/xend-config.sxp:
  
[http://lists.xensource.com/archives/html/xen-users/2006-11/msg00034.html]
+
(network-script freegeek-network-script)
  
echo 'hwcap 0 nosegneg' > /etc/ld.so.conf.d/libc6-xen.conf
+
== to create an instance on the parent server ==
 +
create new xen instances with:
  
appears to not help at all, at least on laze.
+
xen-create-image --hostname SERVERNAME --ip 192.168.?.? --netmask 255.255.255.0 --gateway 192.168.?.1
 
 
When it's all finished, review values in /etc/xen-tools/xen-tools.conf ???
 
 
 
== to create an instance on the parent server ==
 
you create new xen instances with:
 
  
sudo xen-create-image --hostname NAME --debootstrap --mirror http://mirrors.kernel.org/debian --dist etch --ip IP_ADDRESS
+
make sure SERVERNAME and the chosen ip address don't exist already.
  
 
Prepare to wait awhile while this all installs. Kill your time by editing the appropriate dns files and the purpose file in the ass svn project, check your work, and then commit the changes. Then ssh into dns1 and:
 
Prepare to wait awhile while this all installs. Kill your time by editing the appropriate dns files and the purpose file in the ass svn project, check your work, and then commit the changes. Then ssh into dns1 and:
Line 63: Line 66:
 
To get out of the instance, the secret keystroke is ''Ctrl-]''.
 
To get out of the instance, the secret keystroke is ''Ctrl-]''.
  
===problems===
+
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
 +
 +
==problems==
 +
 +
===broken networking===
 
AAAAACK! It seems to have screwed up all networking on all instances on that xen server. I could no longer ssh into any of the instances, though getting to a console and halting the broken instance seems to have cleared up the problem.
 
AAAAACK! It seems to have screwed up all networking on all instances on that xen server. I could no longer ssh into any of the instances, though getting to a console and halting the broken instance seems to have cleared up the problem.
  
Line 77: Line 86:
 
  invoke-rc.d xend restart
 
  invoke-rc.d xend restart
  
=== Also ===
+
===4gb seg fixup messages===
  
reclaim memory for the host machine stolen by stopped xen instances:
+
[http://bugs.debian.org/405223]
  
xm mem-set Domain-0 700
+
i've been unable to verify if this helps at all, but:
  
(for 700MB of ram)
+
[http://lists.xensource.com/archives/html/xen-users/2006-11/msg00034.html]
 
 
There's some mechanism to start instances at boot time i haven't yet explored, but it doesn't sound difficult.
 
  
 +
echo 'hwcap 0 nosegneg' > /etc/ld.so.conf.d/libc6-xen.conf
  
 +
appears to not help at all, at least on laze.
  
 
[[Category:ASS]]
 
[[Category:ASS]]

Revision as of 12:27, 7 December 2007

oh, have fun.

to set create the parent server (out of date?)

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

apt-get install freegeek-xen-server

symlink the kernel and initrd images, otherwise we'll have to manually update each xen instance's configuration file on upgrade:

ln -s /boot/vmlinuz-MOST-RECENT-VERSION /boot/vmlinuz-xen
ln -s /boot/initrd.img-MOST-RECENT-VERSION /boot/initrd.img-xen

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://mirrors.kernel.org/debian/

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

(network-script freegeek-network-script)

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.

Prepare to wait awhile while this all installs. Kill your time by editing the appropriate dns files and the purpose file in the ass svn project, check your work, and then commit the changes. Then ssh into dns1 and:

cd /var/cache/bind
svn update
/etc/init.d/bind9 reload
sudo /etc/init.d/bind9 reload

Continue waiting for your install to happen. Go help out at the Front Desk or something.

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 start the xen instance:

xm create /etc/xen/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

problems

broken networking

AAAAACK! It seems to have screwed up all networking on all instances on that xen server. I could no longer ssh into any of the instances, though getting to a console and halting the broken instance seems to have cleared up the problem.

What step is missing? Should we do the following? This seems wrong since it is a config file for xen itself not the new instance. (And we tried it and it didn't work.)

To get networking to work, i had to uncomment in /etc/xen/xend-config.sxp:

(network-script network-bridge) 

and then restart xend:

invoke-rc.d xend restart

4gb seg fixup messages

[1]

i've been unable to verify if this helps at all, but:

[2]

echo 'hwcap 0 nosegneg' > /etc/ld.so.conf.d/libc6-xen.conf

appears to not help at all, at least on laze.