Xen: restrict devstack VM use upto 8 vCPUs.

Change-Id: Iea6086a3feb03dff581d9c04560133c4f57a6f6c
Closes-Bug: 1672642
This commit is contained in:
jianghua 2017-03-14 08:04:53 +00:00
parent b06229070e
commit 5f8bd0e452
1 changed files with 12 additions and 0 deletions

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
}