On 2020-08-19 10:44:26 -0500, Phil King wrote:
Are there more complete instructions for creating a KVM-based OBS worker?
I am aiming for OBS workers based off of a minimal openSUSE base install (either the openSUSE Leap cloud image or NET .iso).
I can get this to work with a VM install of the OBS appliance (I have both of the .iso and the .qcow2 installs working, as VMs. I do not have the .iso working as a bare metal install, which is confounding…). I would prefer my OBS workers are not full appliance installs.
That is, you want to run the obs worker in a VM, right? You are _not_ talking _building_ in a VM, right? If it is about the former, the following might be a starting point for manually building a VM image that can be used with qemu. Disclaimer: I use the following VM setup only for debugging purposes... so some "important" configs may be missing... (as I said, it probably just serves a starting point) # create a fixed size image with an ext4 fs $> dd if=/dev/zero of=./vm.img iflag=fullblock bs=1MiB count=2048 $> /sbin/mkfs.ext4 vm.img # mount the image + proc $> mount vm.img /mnt/ $> mkdir /mnt/proc $> mount -t proc none /mnt/proc/ # add the tumbleweed repo and install some packages (you may want to install # the obs-worker package/other packages, too) $> zypper --root /mnt/ ar http://download.opensuse.org/tumbleweed/repo/oss/ tw $> zypper --root /mnt/ in --no-recommends aaa_base coreutils util-linux vim \ iproute2 openssh vim vim-data rpm zypper systemd kernel-default dracut \ strace glibc-locale-base less (also, you may want to omit the "--no-recommends" option) # umount proc, create an initrd, setup root pw + user account $> umount /mnt/proc $> chroot /mnt $> dracut --kver 5.8.0-1-default # you might need to adjust the version $> passwd # set root password $> useradd -m marcus $> passwd marcus # set user password $> exit # leave chroot # copy kernel + initrd to the host and umount the image $> cp /mnt/boot/vmlinuz . $> cp /mnt/boot/initrd . $> umount /mnt # start the vm (assumption: port 2222 is not used) and login as root $> qemu-kvm -smp 1 -m 1024 -nographic -no-reboot \ -append "root=/dev/vda rw console=ttyS0 panic=-1" \ -kernel ./vmlinuz -initrd ./initrd \ -drive file=./vm.img,media=disk,if=virtio,format=raw \ -device e1000e,netdev=net1 \ -netdev user,id=net1,ipv4=on,ipv6=off,hostfwd=tcp::2222-10.0.2.7:22 # setup network (you can also use your favorite dhcp client...) and start sshd # (this happens in the guest, of course) $> ip link set dev ens3 up $> ip addr add dev ens3 10.0.2.7/24 # a somewhat arbitrary address $> ip route add default via 10.0.2.2 dev ens3 $> echo nameserver 10.0.2.3 > /etc/resolv.conf $> systemctl start sshd # now, you can login from the host via ssh $> ssh -p 2222 marcus@localhost At this point, you can start installing/configuring the obs-worker. Marcus -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-buildservice+owner@opensuse.org