/usr/share/checkbox/scripts/virt_check is in checkbox 0.13.7.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | #!/bin/bash
# A short script to determine if the test machine will
# funtion properly as a Compute Node in an OpenStack
# environment.
# First, let's see if we have processor flags
virt=$(egrep -m1 -w '^flags[[:blank:]]*:' /proc/cpuinfo | egrep -wo '(vmx|svm)')
[ "$virt" == "vmx" ] && brand="Intel"
[ "$virt" == "svm" ] && brand="AMD"
if [ -z "$virt" ]; then
echo "INFO: Virtualization Flags not found" && exit 1
else
echo "INFO: Virtualization flag $virt indicates $brand processor"
fi
# Now let's do some math
#mem_total=0
#for size in `dmidecode -t 17 | grep Size | grep -vi "No module" |awk '{print $2}'`
#do
# mem_total=$(echo $mem_total + $size |bc)
#done
#
#if [ $mem_total -ge 4096 ]; then
# echo "INFO: System has at least 4096MB, enough for a small Compute Node"
# exit 0
#else
# echo "INFO: System does not have enough RAM to successfully function as a Compute Node"
# exit 1
#fi
# Before we implement the above, let's try this using dmidecode data first. DMI
# Type 16 returns a Physical Memory Array and may supply actual upper bounds.
dmi_mem=$(sudo dmidecode -t 16 | egrep "Maximum Capacity")
dmi_mem_amount=$(echo $dmi_mem | awk '{print $3}')
dmi_mem_unit=$(echo $dmi_mem | awk '{print $4}')
echo "INFO: System claims to support up to $dmi_mem_amount $dmi_mem_unit RAM"
if [ $dmi_mem_amount -ge 32 ]; then
echo "INFO: System should function as a Compute Node"
else
echo "INFO: System does not support enough RAM for a Compute Node"
fi
exit 0
|