Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move first boot to new service #215

Merged
merged 11 commits into from
Jan 10, 2024

Commits on Jan 9, 2024

  1. vms/traffic-gen: Refactor service disable

    Moving the snippet disabling the services to a function.
    
    Signed-off-by: Ram Lavi <[email protected]>
    RamLavi committed Jan 9, 2024
    Configuration menu
    Copy the full SHA
    b62228a View commit details
    Browse the repository at this point in the history
  2. vms/traffic-gen: Refactor hugepages setup

    Moving the snippet setting hugepages to a function.
    
    Signed-off-by: Ram Lavi <[email protected]>
    RamLavi committed Jan 9, 2024
    Configuration menu
    Copy the full SHA
    cdbb07d View commit details
    Browse the repository at this point in the history

Commits on Jan 10, 2024

  1. vms/traffic-gen: refactor setup trex

    Moving trex setup to a function
    
    Signed-off-by: Ram Lavi <[email protected]>
    RamLavi committed Jan 10, 2024
    Configuration menu
    Copy the full SHA
    f169504 View commit details
    Browse the repository at this point in the history
  2. vms/traffic-gen: refactor set unsafe noiommu mode

    Moving setting nsafe_no_io_mmu_mode to a function.
    
    Signed-off-by: Ram Lavi <[email protected]>
    RamLavi committed Jan 10, 2024
    Configuration menu
    Copy the full SHA
    2bc5bc7 View commit details
    Browse the repository at this point in the history
  3. vms/traffic-gen: Move first boot to a separate service

    The first-boot script running by the virt-builder command is run on a
    service created by virt-builder. This service is guaranteed to run in
    the final stages of the boot process [0].
    This may create a race with the checkup, that is waiting on the
    agentConnected condition [1] being added in order to run the checkup's
    executor package. The race is happening since the guest-agent service
    also runs during the final stages of the boot process.
    
    In order to eliminate this race, removing the first-boot script in favor
    of the new service, and moving the first boot script content
    into a new service. This service is
    - manually created on the customize-vm script.
    - explicitly scheduled to run before the guest-agent service runs.
    - running the content of the former first-boot script.
    - running the tuned-adm command formerly set on the customize-vm script.
    The reason is that this command needs to run on a running guest.
    Moreover, since this command needs to only run on the first boot of the
    image, the script is checking the existence of a marker file, then only
    creating the file after the first run of the snippet.
    
    [0] https://www.libguestfs.org/virt-builder.1.html
    [1]
    https://github.com/kiagnose/kubevirt-dpdk-checkup/blob/b9b6a472fe92583a0db46361289239e0e8d06284/pkg/internal/checkup/checkup.go#L237
    [2] https://www.freedesktop.org/software/systemd/man/latest
    systemd.unit.html#ConditionPathExists=
    
    Signed-off-by: Ram Lavi <[email protected]>
    RamLavi committed Jan 10, 2024
    Configuration menu
    Copy the full SHA
    98a75f7 View commit details
    Browse the repository at this point in the history
  4. vms/vm-under-test: Add 'set -e' to the bash script

    Signed-off-by: Ram Lavi <[email protected]>
    RamLavi committed Jan 10, 2024
    Configuration menu
    Copy the full SHA
    c947b98 View commit details
    Browse the repository at this point in the history
  5. vms/vm-under-test: Refactor service disable

    Moving the snippet disabling the services to a function.
    
    Signed-off-by: Ram Lavi <[email protected]>
    RamLavi committed Jan 10, 2024
    Configuration menu
    Copy the full SHA
    3653dca View commit details
    Browse the repository at this point in the history
  6. vms/vm-under-test: Refactor hugepages setup

    Moving the snippet setting hugepages to a function.
    
    Signed-off-by: Ram Lavi <[email protected]>
    RamLavi committed Jan 10, 2024
    Configuration menu
    Copy the full SHA
    04a8b04 View commit details
    Browse the repository at this point in the history
  7. vms/vm-under-test: refactor set unsafe noiommu mode

    Moving setting nsafe_no_io_mmu_mode to a function.
    
    Signed-off-by: Ram Lavi <[email protected]>
    RamLavi committed Jan 10, 2024
    Configuration menu
    Copy the full SHA
    c6b2471 View commit details
    Browse the repository at this point in the history
  8. vms/vm-under-test: Move first boot to a separate service

    The first-boot script running by the virt-builder command is run on a
    service created by virt-builder. This service is guaranteed to run in
    the final stages of the boot process [0].
    This may create a race with the checkup, that is waiting on the
    agentConnected condition [1] being added in order to run the checkup's
    executor package. The race is happening since the guest-agent service
    also runs during the final stages of the boot process.
    
    In order to eliminate this race, removing the first-boot script in favor
    of the new service, and moving the first boot script content
    into a new service. This service is
    - manually created on the customize-vm script.
    - explicitly scheduled to run before the guest-agent service runs.
    - running the content of the former first-boot script.
    - running the tuned-adm command formerly set on the customize-vm script.
    The reason is that this command needs to run on a running guest.
    Moreover, since this command needs to only run on the first boot of the
    image, the script is checking the existence of a marker file, then only
    creating the file after the first run of the snippet.
    
    [0] https://www.libguestfs.org/virt-builder.1.html
    [1]
    https://github.com/kiagnose/kubevirt-dpdk-checkup/blob/b9b6a472fe92583a0db46361289239e0e8d06284/pkg/internal/checkup/checkup.go#L237
    [2] https://www.freedesktop.org/software/systemd/man/latest
    systemd.unit.html#ConditionPathExists=
    
    Signed-off-by: Ram Lavi <[email protected]>
    RamLavi committed Jan 10, 2024
    Configuration menu
    Copy the full SHA
    372cc55 View commit details
    Browse the repository at this point in the history
  9. executor: Expose guest kernel args to log

    It makes sense to log the guest's kernel args of both VMIs for debugging
    purposes.
    
    Signed-off-by: Ram Lavi <[email protected]>
    RamLavi committed Jan 10, 2024
    Configuration menu
    Copy the full SHA
    a7fbd81 View commit details
    Browse the repository at this point in the history