There were many other interesting talks during the conference, all of which can be viewed on the oSC 2017 media site.
A video of my presentation is embedded below.
~/> cd ~ ~/> git clone https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git ~/> git clone https://github.com/rapido-linux/rapido.git
~/> cp rapido/kernel/vanilla_config linux/.config ~/> cd linux ~/linux/> make -j6 ~/linux/> make modules ~/linux/> INSTALL_MOD_PATH=./mods make modules_install
~/linux/> cd ~/rapido ~/rapido/> cp rapido.conf.example rapido.conf ~/rapido/> vi rapido.conf
~/rapido/> ./cut_fstests_local.sh ... dracut: *** Creating initramfs image file 'initrds/myinitrd' done *** ~/rapido/> ls -lah initrds/myinitrd -rw-r--r-- 1 ddiss users 30M Dec 13 18:17 initrds/myinitrd
~/rapido/> ./vm.sh + mount -t btrfs /dev/zram1 /mnt/scratch [ 3.542927] BTRFS info (device zram1): disk space caching is enabled ... btrfs filesystem mounted at /mnt/test and /mnt/scratch rapido1:/#
rapido1:/# shutdown [ 267.304313] sysrq: SysRq : sysrq: Power Off rapido1:/# [ 268.168447] ACPI: Preparing to enter system sleep state S5 [ 268.169493] reboot: Power down + exit 0
~/rapido/> sudo tools/br_setup.sh
~/rapido/> ip addr show br0
4: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
...
inet 192.168.155.1/24 scope global br0
~/> git clone https://github.com/ceph/ceph ~/> cd ceph <install Ceph build dependencies> ~/ceph/> ./do_cmake.sh -DWITH_MANPAGE=0 -DWITH_OPENLDAP=0 -DWITH_FUSE=0 -DWITH_NSS=0 -DWITH_LTTNG=0 ~/ceph/> cd build ~/ceph/build/> make -j4
~/ceph/build/> OSD=3 MON=1 RGW=0 MDS=1 ../src/vstart.sh -i 192.168.155.1 -n
...
~/ceph/build/> bin/ceph -c status
...
health HEALTH_OK
monmap e2: 1 mons at {a=192.168.155.1:40160/0}
election epoch 4, quorum 0 a
fsmap e5: 1/1/1 up {0=a=up:active}
mgr no daemons active
osdmap e10: 3 osds: 3 up, 3 in
~/ceph/build/> cd ~/rapido ~/rapido/> vi rapido.conf
~/rapido/> ./cut_cephfs.sh
... dracut: *** Creating initramfs image file 'initrds/myinitrd' done ***
~/rapido/> ./vm.sh
...
+ mount -t ceph 192.168.155.1:40160:/ /mnt/cephfs -o name=admin,secret=... [ 3.492742] libceph: mon0 192.168.155.1:40160 session established ... rapido1:/# df -h /mnt/cephfs Filesystem Size Used Avail Use% Mounted on 192.168.155.1:40160:/ 1.3T 611G 699G 47% /mnt/cephfsCephFS is a clustered filesystem, in which case testing from multiple clients is also of interest. From another window, boot a second VM:
~/rapido/> ./vm.sh
![]() |
| Test Environment Overview - image based on content by Sage Weil |
> sudo /sbin/brctl addbr br0 > sudo ip addr add 192.168.155.1/24 dev br0 > sudo ip link set dev br0 up
> sudo /sbin/tunctl -u $(whoami) -t tap0 > sudo /sbin/brctl addif br0 tap0 > sudo ip link set tap0 up
> cd $ceph_source_dir <build Ceph> > cd src > OSD=3 MON=1 RGW=0 MDS=1 ./vstart.sh -i 192.168.155.1 -n --memstore
> cd $kernel_source_dir > make menuconfig$kernel_source_dir should be replaced with the actual path. Ensure CONFIG_BLK_DEV_RBD=m, CONFIG_CEPH_FS=y, CONFIG_CEPH_LIB=y, CONFIG_E1000=y and CONFIG_IP_PNP=y are set in the kernel config. A sample can be found here.
> make > INSTALL_MOD_PATH=./mods make modules_install
Create a link to the modules directory ./mods, so that Dracut can find them:
> sudo ln -s $PWD/mods/lib/modules/$(make kernelrelease) \
/lib/modules/$(make kernelrelease)
> export CEPH_SRC=$ceph_source_dir/src
> dracut --no-compress --kver "$(cat include/config/kernel.release)" \
--install "tail blockdev ps rmdir resize dd vim grep find df sha256sum \
strace mkfs.xfs /lib64/libkeyutils.so.1" \
--include "$CEPH_SRC/mount.ceph" "/sbin/mount.ceph" \
--include "$CEPH_SRC/ceph.conf" "/etc/ceph/ceph.conf" \
--add-drivers "rbd" \
--no-hostonly --no-hostonly-cmdline \
--modules "bash base network ifcfg" \
--force myinitrd
> qemu-kvm -smp cpus=2 -m 512 \
-kernel arch/x86/boot/bzImage -initrd myinitrd \
-device e1000,netdev=network1,mac=b8:ac:6f:31:45:70 \
-netdev tap,id=network1,script=no,downscript=no,ifname=tap0 \
-append "ip=192.168.155.2:::255.255.255.0:myhostname \
rd.shell=1 console=ttyS0 rd.lvm=0 rd.luks=0" \
-nographic
dracut:/# ip a
...
2: eth0: ... mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether b8:ac:6f:31:45:70 brd ff:ff:ff:ff:ff:ff
inet 192.168.155.2/24 brd 192.168.155.255 scope global eth0
> cd $ceph_source_dir/src > ./rados lspools rbd ...
> ./rbd create --image-format 1 --size 1024 1g_vstart_img > ./rbd ls -l NAME SIZE PARENT FMT PROT LOCK 1g_vstart_img 1024M 1
dracut:/# modprobe rbd [ 9.031056] rbd: loaded dracut:/# echo -n "192.168.155.1:6789 name=admin,secret=AQBPiuhd9389dh28djASE32Ceiojc234AF345w== rbd 1g_vstart_img -" > /sys/bus/rbd/add [ 347.743272] libceph: mon0 192.168.155.1:6789 session established [ 347.744284] libceph: client4121 fsid 234b432f-a895-43d2-23fd-9127a1837b32 [ 347.749516] rbd: rbd0: added with size 0x40000000
dracut:/# mkfs.xfs /dev/rbd0 ... dracut:/# mkdir -p /mnt/rbdfs dracut:/# mount /dev/rbd0 /mnt/rbdfs [ 415.841757] XFS (rbd0): Mounting V4 Filesystem [ 415.917595] XFS (rbd0): Ending clean mount dracut:/# df -h /mnt/rbdfs Filesystem Size Used Avail Use% Mounted on /dev/rbd0 1014M 33M 982M 4% /mnt/rbdfs
> cd $ceph_source_dir/src > ./ceph fs ls > name: cephfs_a, metadata pool: cephfs_metadata_a, data pools: [cephfs_data_a ]All that's left is to mount it from the kernel VM using the mount.ceph binary that was copied into the initramfs:
dracut:/# mkdir -p /mnt/mycephfs
dracut:/# mount.ceph 192.168.155.1:6789:/ /mnt/mycephfs \
-o name=admin,secret=AQBPiuhd9389dh28djASE32Ceiojc234AF345w==
[ 723.103153] libceph: mon0 192.168.155.1:6789 session established
[ 723.184978] libceph: client4122 fsid 234b432f-a895-43d2-23fd-9127a1837b32
dracut:/# df -h /mnt/mycephfs/
Filesystem Size Used Avail Use% Mounted on
192.168.155.1:6789:/ 3.0G 4.0M 3.0G 1% /mnt/mycephfs
dracut:/# umount /mnt/mycephfsUnmount the RBD image:
dracut:/# umount /dev/rbd0 [ 1592.592510] XFS (rbd0): Unmounting FilesystemUnmap the RBD image (0 is derived from /dev/rbdX):
dracut:/# echo -n 0 > /sys/bus/rbd/removePower-off the VM:
dracut:/# echo 1 > /proc/sys/kernel/sysrq && echo o > /proc/sysrq-trigger [ 1766.387417] sysrq: SysRq : Power Off dracut:/# [ 1766.811686] ACPI: Preparing to enter system sleep state S5 [ 1766.812217] reboot: Power downShutdown the Ceph cluster:
> cd $ceph_source_dir/src > ./stop.sh
> sudo ip link add br0 type bridge
> sudo ip addr flush dev eth0Add the interface to the bridge:
> sudo ip link set eth0 master br0
> sudo ip tuntap add dev tap0 mode tap user $(whoami)The user parameter ensures that the current user will be able to connect to the TAP interface.
> sudo ip link set tap0 master br0
> sudo ip link set dev br0 up > sudo ip link set dev tap0 up
> qemu-kvm -kernel arch/x86/boot/bzImage \
-initrd initramfs \
-device e1000,netdev=network0,mac=52:55:00:d1:55:01 \
-netdev tap,id=network0,ifname=tap0,script=no,downscript=no \
-append "ip=dhcp rd.shell=1 console=ttyS0" -nographic
[ 3.792570] e1000: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX [ 3.796085] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready [ 3.812083] Sending DHCP requests ., OK [ 4.824174] IP-Config: Got DHCP answer from 10.155.0.42, my address is 10.155.0.1 [ 4.825119] IP-Config: Complete: [ 4.825476] device=eth0, hwaddr=52:55:00:d1:55:01, ipaddr=10.155.0.1, mask=255.255.0.0, gw=10.155.0.254 [ 4.826546] host=rocksolid-sles, domain=suse.de, nis-domain=suse.de ...
~/> git clone \
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
hack, hack, hack.
~/linux/> make menuconfig
Set CONFIG_IP_PNP_DHCP=y and CONFIG_E1000=y to enable IP address assignment on boot.
~/linux/> make -j6
~/linux/> make modules
~/linux/> INSTALL_MOD_PATH=./mods make modules_install
~/linux/> sudo ln -s $PWD/mods/lib/modules/$(make kernelrelease) \
/lib/modules/$(make kernelrelease)
This leaves us with a compressed kernel image file at arch/x86/boot/bzimage, and corresponding modules installed under mods/lib/module/$(make kernelrelease), where $(make kernelrelease) evaluates to 4.1.0-rc7+ in this example. The /lib/modules/4.1.0-rc7+ symlink allows Dracut to locate the modules.~/linux/> dracut --kver "$(make kernelrelease)" \
--add-drivers "iscsi_target_mod target_core_mod" \
--add-drivers "target_core_file target_core_iblock" \
--add-drivers "configfs" \
--install "ps grep netstat" \
--no-hostonly --no-hostonly-cmdline \
--modules "bash base shutdown network ifcfg" initramfs
...
*** Creating image file done ***
~/linux/> qemu-kvm -kernel arch/x86/boot/bzImage \
-initrd initramfs \
-device e1000,netdev=network0 \
-netdev user,id=network0 \
-redir tcp:51550::3260 \
-append "ip=dhcp rd.shell=1 console=ttyS0" \
-nographic
[ 3.216596] dracut Warning: dracut: FATAL: No or empty root= argument [ 3.217998] dracut Warning: dracut: Refusing to continue ... Dropping to debug shell. dracut:/#
dracut:/# ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default ...
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
...
inet 10.0.2.15/24 brd 10.0.2.255 scope global eth0
dracut:/# modprobe iscsi_target_mod dracut:/# cat /proc/modules iscsi_target_mod 246669 0 - Live 0xffffffffa006a000 target_core_mod 289004 1 iscsi_target_mod, Live 0xffffffffa000b000 configfs 22407 3 iscsi_target_mod,target_core_mod, Live 0xffffffffa0000000
dracut:/# mount -t configfs configfs /sys/kernel/config/ dracut:/# cat /sys/kernel/config/target/version Target Engine Core ConfigFS Infrastructure v4.1.0 on Linux/x86_64 on 4.1.0-rc1+
dracut:/# mkdir /sys/kernel/config/target/iscsi
dracut:/# echo -n 0 > /sys/kernel/config/target/iscsi/discovery_auth/enforce_discovery_auth dracut:/# mkdir -p /sys/kernel/config/target/iscsi/<iscsi_iqn>/tpgt_1/np/10.0.2.15:3260 ...
~/linux/> iscsiadm --mode discovery \
--type sendtargets \
--portal 127.0.0.1:51550
10.0.2.15:3260,1 iqn.2015-04.suse.arch:5eca2313-028d-435c-9131-53a5ab256a83
~/linux/> dracut -i runme.sh /lib/dracut/hooks/emergency/02-runme.sh ...
~/linux/> INSTALL_MOD_PATH=./mods make modules_install ~/linux/> dracut --kver "$(make kernelrelease)" --kmoddir ./mods/lib/...