Skip to main content

Host Resource Management Script

Use scripts/host-resource-management.sh as the operator wrapper for host CPU policy, memory oversubscription, live shared execution-pool policy, and clock tiering experiments.

./scripts/host-resource-management.sh <action> [ansible-playbook args]

The wrapper runs from the repository root and uses inventory/hosts.yml. Status actions inspect live host state directly with systemctl, virsh, and /sys reads. Apply and rollback actions call the Ansible playbooks listed below.

Normal Order

Run the host foundation before applying the live VM policy.

./scripts/host-resource-management.sh host-resource-management-apply
./scripts/host-resource-management.sh host-memory-oversubscription-apply
./scripts/host-resource-management.sh shared-execution-pool-apply
./scripts/host-resource-management.sh shared-execution-pool-status

The shared execution-pool action expects the managed worker domains to already exist and be running:

VMTierTarget CPUWeight
kvm-worker-01Gold512
kvm-worker-02Silver333
kvm-worker-03Bronze167

Actions

ActionBehavior
host-resource-management-applyRuns playbooks/maintenance/host-resource-management-apply.yml. Installs systemd manager and machine slice policy from vars/global/host_resource_management.yml.
host-resource-management-rollbackRuns playbooks/maintenance/host-resource-management-rollback.yml. Removes the host resource policy files and reloads affected services.
host-resource-management-statusInspects configured CPU pools, performance-domain weights, systemd drop-ins, machine slices, and irqbalance state.
host-memory-oversubscription-applyRuns playbooks/maintenance/host-memory-oversubscription-apply.yml. Applies zram, THP, and KSM policy from vars/global/host_memory_oversubscription.yml.
host-memory-oversubscription-rollbackRuns playbooks/maintenance/host-memory-oversubscription-rollback.yml. Stops the policy unit and restores rollback values.
host-memory-oversubscription-statusInspects the live zram, THP, KSM, and service state.
shared-execution-pool-applyRuns cgroup-tiering-apply-v1.yml, then contention-tiering-apply-v1.yml. This is the default live VM policy action.
shared-execution-pool-rollbackRuns contention-tiering-rollback-v1.yml, then cgroup-tiering-rollback-v1.yml.
shared-execution-pool-statusShows whether managed workers look like shared execution-pool, clock-tiered, stock, or mixed state.
contention-statusShows only the live Gold, Silver, and Bronze CPUWeight state.
contention-applyRuns playbooks/maintenance/contention-tiering-apply-v1.yml.
contention-rollbackRuns playbooks/maintenance/contention-tiering-rollback-v1.yml.
clock-statusShows the live per-VM cpuset, emulator pinning, and CPU max-frequency state for the clock-tiering experiment.
clock-applyRuns playbooks/maintenance/clock-frequency-tiering-apply-v1.yml.
clock-rollbackRuns playbooks/maintenance/clock-frequency-tiering-rollback-v1.yml.

Legacy aliases are still accepted:

AliasCurrent action
applyshared-execution-pool-apply
rollbackshared-execution-pool-rollback
statusshared-execution-pool-status

Passing Ansible Arguments

Extra arguments are forwarded to ansible-playbook for apply and rollback actions.

./scripts/host-resource-management.sh shared-execution-pool-apply --ask-vault-pass

Status actions do not call Ansible and do not use forwarded playbook arguments.