Add description of os_mount field in job.yaml.
This patch is the description when os_mount=local, and other values of os_mount will be added in the patch later.
Signed-off-by: Yu Chuan 13186087857@163.com --- doc/job/os_mount.md | 89 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 doc/job/os_mount.md
diff --git a/doc/job/os_mount.md b/doc/job/os_mount.md new file mode 100644 index 000000000000..257bc12619fe --- /dev/null +++ b/doc/job/os_mount.md @@ -0,0 +1,89 @@ +# Summary +========= + +`os_mount` defines the mount method of testbox's root partition. + +It has the following optional values: + - nfs + - cifs + - initramfs + - container + - local + +Usage example: + - submit iperf.yaml testbox=vm-2p8g os_mount=nfs + - submit iperf.yaml testbox=vm-2p8g os_mount=cifs + - submit iperf.yaml testbox=vm-2p8g os_mount=initramfs + - submit iperf.yaml testbox=dc-8g os_mount=container + - submit iperf.yaml testbox=vm-2p8g os_mount=local + +# Optional Values +================= + +## Work flow when os_mount=local + +1. user submit job with os_mount: local + - optional kernel cmdline params: # can be added in {kernel_append_root} field of job.yaml + - save_root: give an iconic string, then the root partition data used by this job will be retained. + and you can use the root partition data of this job in the futher job by {use_root}. + - use_root : give an iconic string, then the root partition data generated by + the pervious job which has the {save_root} field will be used. + - tips: + - value of {save_root} and {use_root} need to be iconic enough, uuid is recommended. + - value of {save_root} and {use_root} will be the suffix of logical volume. + +2. scheduler return the ipxe_str to testbox + ``` + dhcp + initrd http://$%7Bhttp_server_ip%7D:$%7Bhttp_server_port%7D/os/openeuler/aarch64/20... + initrd http://$%7Bhttp_server_ip%7D:$%7Bhttp_server_port%7D/os/openeuler/aarch64/20... + imgargs vmlinux root=/dev/mapper/os-openeuler_aarch64_20.03 rootfs_src={nfs_server_ip}:os/openeuler/aarch64/20.03-iso-snapshots/{timestamp} initrd=initrd.lkp {kernel_append_root} + boot + ``` + +3. dracut step of boot + ``` + if have {use_root}; then + base_lv_name=openeuler_aarch64_20.03_{value_use_root} + lvdisplay /dev/mappaer/os-{base_lv_name} > /dev/null || exit 1 + + if have {save_root}; then + boot_lv_name=openeuler_aarch64_20.03_{value_save_root} + + if {save_root} == {use_root}; then + boot from /dev/mappaer/os-{boot_lv_name} + fi + + lvremove -f /dev/mappaer/os-{boot_lv_name} + create /dev/mappaer/os-{boot_lv_name} from /dev/mappaer/os-{base_lv_name} + boot from /dev/mappaer/os-{boot_lv_name} + else + boot_lv_name=openeuler_aarch64_20.03_{value_use_root} + boot from /dev/mappaer/os-{boot_lv_name} + fi + + else: + base_lv_name=openeuler_aarch64_20.03_{timestamp} + lvdisplay /dev/mappaer/os-{base_lv_name} > /dev/null || { + # rsync nfsroot to lvm:/dev/mapper/os-{base_lv_name} + mount -t nfs {nfs_server_ip}:os/openeuler/aarch64/20.03-iso-snapshots/{timestamp} /mnt + mkdir /mnt1 && mount /dev/mapper/os-{base_lv_name} /mnt1 + cp -a /mnt/. /mnt1/ + umount /mnt /mnt1 + + # change premission of lvm:/dev/mapper/os-{base_lv_name} to readonly + lvchange -p r /dev/mapper/os-{base_lv_name} + } + + boot_lv_name=openeuler_aarch64_20.03 + if have {save_root}; then + boot_lv_name=openeuler_aarch64_20.03_{value_save_root} + fi + + lvremove -f /dev/mappaer/os-{boot_lv_name} + create /dev/mappaer/os-{boot_lv_name} from /dev/mappaer/os-{base_lv_name} + boot from /dev/mappaer/os-{boot_lv_name} + fi + ``` + +4. execute the job