Merge "Xen: restrict devstack VM use upto 8 vCPUs."

This commit is contained in:
Jenkins 2017-03-17 15:49:33 +00:00 committed by Gerrit Code Review
commit c292223f13

View File

@ -294,6 +294,18 @@ function max_vcpus {
# Assert ithas a numeric nonzero value
expr "$cpu_count" + 0
# 8 VCPUs should be enough for devstack VM; avoid using too
# many VCPUs:
# 1. too many VCPUs may trigger a kernel bug which result VM
# not able to boot:
# https://kernel.googlesource.com/pub/scm/linux/kernel/git/wsa/linux/+/e2e004acc7cbe3c531e752a270a74e95cde3ea48
# 2. The remaining CPUs can be used for other purpose:
# e.g. boot test VMs.
MAX_VCPUS=8
if [ $cpu_count -ge $MAX_VCPUS ]; then
cpu_count=$MAX_VCPUS
fi
xe vm-param-set uuid=$vm VCPUs-max=$cpu_count
xe vm-param-set uuid=$vm VCPUs-at-startup=$cpu_count
}