Merge "labs: option to set number of vCPUs for each node"

This commit is contained in:
Jenkins 2014-08-19 20:56:08 +00:00 committed by Gerrit Code Review
commit 8926a043e0
3 changed files with 12 additions and 0 deletions

View File

@ -10,3 +10,6 @@ FOURTH_OCTET=53
NET_IF_0=nat
NET_IF_1=MGMT_NET
NET_IF_2=DATA_NET
# Override number of virtual CPUs (default is 1)
VM_CPUS=2

View File

@ -291,6 +291,12 @@ function vm_mem {
$VBM modifyvm "$NAME" --memory "$MEM"
}
function vm_cpus {
local NAME="$1"
local CPUS="$2"
$VBM modifyvm "$NAME" --cpus "$CPUS"
}
# Port forwarding from host to VM (binding to host's 127.0.0.1)
function vm_port {
local NAME="$1"

View File

@ -50,6 +50,9 @@ function vm_build_node {
# Set VM_MEM in config/config.NODE_NAME to override
vm_mem "$NODE_NAME" "${VM_MEM:-512}"
# Set VM_CPUS in config/config.NODE_NAME to override
vm_cpus "$NODE_NAME" "${VM_CPUS:-1}"
_vbox_configure_ifs
# Port forwarding