From 2c94ee5237a453a0024bdcc6c6d3f4805534f56e Mon Sep 17 00:00:00 2001 From: Joe Gordon Date: Fri, 2 Aug 2013 02:02:01 +0000 Subject: [PATCH] Add support for running multiple n-cpus for performance testing When using the fake VIRT_DRIVER, we can launch an arbitrary number of instances, the next step for performance testing is running an arbitrary number of n-cpus. This can be done with the following settings in your localrc VIRT_DRIVER=fake NUMBER_FAKE_NOVA_COMPUTE=50 This can be used for things like measuring load from n-cpu's periodic tasks. Change-Id: I40e0f05374e2c10c48ea6b8816ef6e7609b3dc80 --- lib/nova | 5 +++++ stackrc | 3 +++ 2 files changed, 8 insertions(+) diff --git a/lib/nova b/lib/nova index 7a5ff1f98a..9c38498d8c 100644 --- a/lib/nova +++ b/lib/nova @@ -722,6 +722,11 @@ function start_nova() { # The group **$LIBVIRT_GROUP** is added to the current user in this script. # Use 'sg' to execute nova-compute as a member of the **$LIBVIRT_GROUP** group. screen_it n-cpu "cd $NOVA_DIR && sg $LIBVIRT_GROUP '$NOVA_BIN_DIR/nova-compute --config-file $NOVA_CONF_BOTTOM'" + elif [[ "$VIRT_DRIVER" = 'fake' ]]; then + for i in `seq 1 $NUMBER_FAKE_NOVA_COMPUTE` + do + screen_it n-cpu "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-compute --config-file $NOVA_CONF_BOTTOM" + done else screen_it n-cpu "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-compute --config-file $NOVA_CONF_BOTTOM" fi diff --git a/stackrc b/stackrc index 36171cc579..8d9c1f2c61 100644 --- a/stackrc +++ b/stackrc @@ -187,6 +187,9 @@ case "$VIRT_DRIVER" in LIBVIRT_GROUP=libvirtd fi ;; + fake) + NUMBER_FAKE_NOVA_COMPUTE=${NUMBER_FAKE_NOVA_COMPUTE:-1} + ;; xenserver) # Xen config common to nova and neutron XENAPI_USER=${XENAPI_USER:-"root"}