[opensuse-buildservice] OBS: using KVM autosetup with OBS workers and osc build
export rootfstype="ext4" mkinitrd -d /dev/null -m "ext4 binfmt_misc virtio_pci virtio_blk" -k vmlinuz-2.6.31.12-0.1-default -i initrd-2.6.31.12-0.1-default-obs_worker If your kernel is vmlinuz-2.6.31.12-0.1-default. 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
Hi, 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: 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" | "none" OBS_VM_TYPE="auto" # if your default kernel you boot is /boot/vmlinuz-2.6.31.12-0.1-default, then type this into the variable OBS_VM_KERNEL="/boot/vmlinuz-2.6.31.12-0.1-default" # A fitting initrd, with KVM virtio enabled OBS_VM_INITRD="/boot/initrd-2.6.31.12-0.1-default-obs_worker" # This activates generation of root fs and swapspace for the virtual machines, as always, under /tmp/root_<workerid>, if you have nothing else configured OBS_VM_DISK_AUTOSETUP="yes" # 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. OBS_VM_DISK_AUTOSETUP_ROOT_FILESIZE="4096" # 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. OBS_VM_DISK_AUTOSETUP_SWAP_FILESIZE="1024" # The filesystem type used as root filesystem. Make sure the kernel module for this filesystem is in your initrd for KVM OBS_VM_DISK_AUTOSETUP_FILESYSTEM="ext4" # The size of memory the KVM gets, also in MB OBS_INSTANCE_MEMORY="1024" 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 Martin -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
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:
export rootfstype=3D"ext4" mkinitrd -d /dev/null -m "ext4 binfmt_misc virtio_pci virtio_blk" -k vmlinuz-2.6.31.12-0.1-default -i initrd-2.6.31.12-0.1-default-obs_worker If your kernel is vmlinuz-2.6.31.12-0.1-default. 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
Hi, =20 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. =20 To get it working, its now quite easy. It only requires: =20 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 =20 =20 Step nr. 1 is hopefully quite clear. Step nr. hopefully also. Step nr. 3 is calling zypper or yast and install kvm. =20 Step nr. 4: become root, cd /boot. then type: performance compared to ext3 =20 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: =20 # This enables KVM if available. values are "auto" | "xen" | "kvm" | "non= e" OBS_VM_TYPE=3D"auto" =20 # if your default kernel you boot is /boot/vmlinuz-2.6.31.12-0.1-default, then type this into the variable OBS_VM_KERNEL=3D"/boot/vmlinuz-2.6.31.12-0.1-default" =20 # A fitting initrd, with KVM virtio enabled OBS_VM_INITRD=3D"/boot/initrd-2.6.31.12-0.1-default-obs_worker" =20 # This activates generation of root fs and swapspace for the virtual machines, as always, under /tmp/root_<workerid>, if you have nothing else configured OBS_VM_DISK_AUTOSETUP=3D"yes" =20 # 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. OBS_VM_DISK_AUTOSETUP_ROOT_FILESIZE=3D"4096" =20 # 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. OBS_VM_DISK_AUTOSETUP_SWAP_FILESIZE=3D"1024" =20 # The filesystem type used as root filesystem. Make sure the kernel module for this filesystem is in your initrd for KVM OBS_VM_DISK_AUTOSETUP_FILESYSTEM=3D"ext4" =20 # The size of memory the KVM gets, also in MB OBS_INSTANCE_MEMORY=3D"1024" =20 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. =20 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. =20 Have Fun =20 Martin =20 --=20 To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org =20
Hi, what you think about adding also a "Nr. of CPU" variable allowing to run each KVM machine with more than a single CPU core? KVM itself has a smp option to start with more than a CPU core. Martin -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
Am Dienstag, 30. März 2010 13:27:28 schrieb Martin Mohring:
Hi,
what you think about adding also a "Nr. of CPU" variable allowing to run each KVM machine with more than a single CPU core?
KVM itself has a smp option to start with more than a CPU core.
Yes, this is at least a default which would make sense. -- Adrian Schroeter SUSE Linux Products GmbH email: adrian@suse.de -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
participants (3)
-
Adrian Schröter
-
Luke Imhoff
-
Martin Mohring