Mailinglist Archive: opensuse-buildservice (216 mails)

< Previous Next >
Re: Re: [opensuse-buildservice] OBS: using KVM autosetup with OBS workers and osc build
  • From: Luke Imhoff <luke@xxxxxxxx>
  • Date: Mon, 29 Mar 2010 09:43:31 -0500
  • Message-id: <5D6E0DF460ACF34C88644E1EA91DCD0D0657C816@xxxxxxxxxxxxxxxxxxxxxxxxx>
I talked with Adrian about this (for osc) at BrainShare last week. Glad
to see that I don't have to figure out how to do it myself now. Thanks
for the this great feature Martin and Jan-Simon!

On Mon, 2010-03-29 at 00:15 +0200, Martin Mohring wrote:
Jan-Simon and me had been pushing some patches into Git tree to support
Autosetup of KVM in case you want to use Virtualization with OBS workers
or osc build.
To get it working, its now quite easy. It only requires:
1. An x86 machine with Hardware Virtualization. Boot the machine with
hardware virtualization enabled.
2. A openSUSE 11.2 with a 2.6.31 kernel or newer
3. Installation of the package "kvm" on the worker machine
4. Generation of an initrd file with virtio so KVM performs also well
wrt. to IO
5. Setting up of /etc/sysconfig/obs-worker appropriately
Step nr. 1 is hopefully quite clear. Step nr. hopefully also. Step nr. 3
is calling zypper or yast and install kvm.
Step nr. 4: become root, cd /boot. then type:
export rootfstype=3D"ext4" mkinitrd -d /dev/null -m "ext4 binfmt_misc
virtio_pci virtio_blk" -k vmlinuz- -i
If your kernel is vmlinuz- I could be that there
is also a newer kernel downloadable already. then replace it with that
kernel version number
Activating virtio is very strongly recommended, and using ext4 as the
filesystem also. ext4 tends to be ca. factor 2.5 or better wr. to
performance compared to ext3
Step nr. 5: setting up /etc/sysconfig/obs-worker
There are new environment variables for setting up the virtual machine
for KVM (XEN could also work, we have not tested it). They are in the
template file in the Git tree.
Some useful settings for them are:
# This enables KVM if available. values are "auto" | "xen" | "kvm" | "non=
# if your default kernel you boot is
/boot/vmlinuz-, then type this into the variable
# A fitting initrd, with KVM virtio enabled
# This activates generation of root fs and swapspace for the virtual
machines, as always, under /tmp/root_<workerid>, if you have nothing
else configured
# This is the size of root fs in MB. Note: it is a sparse file, which
grows when accessed. It helps to have some buffer for free memory in the
rootfs, without actually allocating the space on disk.
# Dito, for the Swapspace. If you have very much memory on the machine,
and lots of memory left, then swapspace can be small. Size in MB.
# The filesystem type used as root filesystem. Make sure the kernel
module for this filesystem is in your initrd for KVM
# The size of memory the KVM gets, also in MB
Once you have installed the code in the OBS backend and in the workers,
have fun with this. Code is in the current Git master.
There are also .oscrc variables to setup the same for "osc build", so
you can use KVM then also for local build. ARM support should still be
working fine, thats why your initrd has to contain "binfmt" loadable
module. I will post another mail for the osc variant of this next.
Have Fun
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-buildservice+help@xxxxxxxxxxxx

< Previous Next >