Last active
September 13, 2018 13:13
-
-
Save Tahvok/6233c0f48568bb7162f1f9c2a2f85509 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
while read -r instance; do | |
while read -r current_node_cpus; do | |
current_node=(); | |
for i in $current_node_cpus; do | |
current_node[i]=1 | |
done | |
notfound=() | |
found_at_least_one=0 | |
while read -r cpu; do | |
if [[ ! ${current_node[cpu]} ]]; then | |
notfound+=("$cpu"); | |
else | |
found_at_least_one=1 | |
fi | |
done < <(virsh dumpxml "$instance" | awk '/vcpupin/{split($0,a,"="); split(a[3],cpu,"'\''"); print cpu[2]}') | |
if [[ "$found_at_least_one" == "1" ]] && [[ ${#notfound[@]} -ne 0 ]]; then | |
echo "CPU pinning on instance $instance is wrong! Probably this are the wrong pins: ${notfound[@]}" | |
break | |
fi | |
done < <(numactl --hard | awk '/cpus:/{split($0,a,":"); print a[2];}') | |
done < <(virsh list --name --all | grep -v "^$") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment