Simulate Block Device Latency

    note

    BlockChaos is in an early stage. The installation and configuration experience of it will continue to improve. If you find any issues, please open an issue in to report.

    BlockChaos depends on the kernel module. It can only be injected on a machine with this module installed. Currently, you have to compile and install the module manually.

    1. Download the source code of this module using the following command:

    2. If you are using Ubuntu/Debian, you can install the kernel headers with apt:

      1. apt install linux-headers-$(uname -r)
    3. Compile the module:

    The chaos_driver module has to be installed every time after rebooting. To load the module automatically, you can copy the module to a subdirectory in /lib/modules/$(uname -r)/kernel/drivers, run depmod -a, and then add chaos_driver to the /etc/modules.

    If you have upgraded the kernel, the module should be recompiled.

    It is recommended to use DKMS or akmod for automatic kernel module compiling or loading. If you want to help us improve the installation experience, creating a DKMS or akmod package and submitting it to different distribution repositories is very welcome.

    1. Write the experiment configuration to the YAML configuration file. The following uses the block-latency.yaml file as an example.

      Simulate Block Device Latency - 图3note

      Only hostpath or localvolume is supported.

    2. Use to create an experiment:

      1. kubectl apply -f block-latency.yaml
    1. The ioem or ioem-mq scheduler will receive the latency request and delay the request for the specified time.

    The fields in the YAML configuration file are described in the following table: