Browse code

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

Joe Gordon authored on 2013/08/02 11:02:01
Showing 2 changed files
... ...
@@ -722,6 +722,11 @@ function start_nova() {
722 722
         # The group **$LIBVIRT_GROUP** is added to the current user in this script.
723 723
         # Use 'sg' to execute nova-compute as a member of the **$LIBVIRT_GROUP** group.
724 724
         screen_it n-cpu "cd $NOVA_DIR && sg $LIBVIRT_GROUP '$NOVA_BIN_DIR/nova-compute --config-file $NOVA_CONF_BOTTOM'"
725
+    elif [[ "$VIRT_DRIVER" = 'fake' ]]; then
726
+       for i in `seq 1 $NUMBER_FAKE_NOVA_COMPUTE`
727
+       do
728
+           screen_it n-cpu "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-compute --config-file $NOVA_CONF_BOTTOM"
729
+       done
725 730
     else
726 731
         screen_it n-cpu "cd $NOVA_DIR && $NOVA_BIN_DIR/nova-compute --config-file $NOVA_CONF_BOTTOM"
727 732
     fi
... ...
@@ -187,6 +187,9 @@ case "$VIRT_DRIVER" in
187 187
             LIBVIRT_GROUP=libvirtd
188 188
         fi
189 189
         ;;
190
+    fake)
191
+        NUMBER_FAKE_NOVA_COMPUTE=${NUMBER_FAKE_NOVA_COMPUTE:-1}
192
+        ;;
190 193
     xenserver)
191 194
         # Xen config common to nova and neutron
192 195
         XENAPI_USER=${XENAPI_USER:-"root"}