Devstack has some little known variables for running nova
with the fake compute driver and running several nova-compute
services on a single host, which can be useful for testing
move operations and scale testing of controller services like
nova-api and nova-scheduler.
This adds documentation about the fake virt driver and related
variables and scaling considerations when using them.
Change-Id: Ic89d463d0f3f180b323edd6e2c8ff0404638ef07
| ... | ... |
@@ -68,3 +68,69 @@ These config options are defined in `nova.conf.serial_console |
| 68 | 68 |
For more information on OpenStack configuration see the `OpenStack |
| 69 | 69 |
Compute Service Configuration Reference |
| 70 | 70 |
<https://docs.openstack.org/nova/latest/admin/configuration/index.html>`_ |
| 71 |
+ |
|
| 72 |
+ |
|
| 73 |
+Fake virt driver |
|
| 74 |
+================ |
|
| 75 |
+ |
|
| 76 |
+Nova has a `fake virt driver`_ which can be used for scale testing the control |
|
| 77 |
+plane services or testing "move" operations between fake compute nodes, for |
|
| 78 |
+example cold/live migration, evacuate and unshelve. |
|
| 79 |
+ |
|
| 80 |
+The fake virt driver does not communicate with any hypervisor, it just reports |
|
| 81 |
+some fake resource inventory values and keeps track of the state of the |
|
| 82 |
+"guests" created, moved and deleted. It is not feature-complete with the |
|
| 83 |
+compute API but is good enough for most API testing, and is also used within |
|
| 84 |
+the nova functional tests themselves so is fairly robust. |
|
| 85 |
+ |
|
| 86 |
+.. _fake virt driver: http://git.openstack.org/cgit/openstack/nova/tree/nova/virt/fake.py |
|
| 87 |
+ |
|
| 88 |
+Configuration |
|
| 89 |
+------------- |
|
| 90 |
+ |
|
| 91 |
+Set the following in your devstack ``local.conf``: |
|
| 92 |
+ |
|
| 93 |
+.. code-block:: ini |
|
| 94 |
+ |
|
| 95 |
+ [[local|localrc]] |
|
| 96 |
+ VIRT_DRIVER=fake |
|
| 97 |
+ NUMBER_FAKE_NOVA_COMPUTE=<number> |
|
| 98 |
+ |
|
| 99 |
+The ``NUMBER_FAKE_NOVA_COMPUTE`` variable controls the number of fake |
|
| 100 |
+``nova-compute`` services to run and defaults to 1. |
|
| 101 |
+ |
|
| 102 |
+When ``VIRT_DRIVER=fake`` is used, devstack will disable quota checking in |
|
| 103 |
+nova and neutron automatically. However, other services, like cinder, will |
|
| 104 |
+still enforce quota limits by default. |
|
| 105 |
+ |
|
| 106 |
+Scaling |
|
| 107 |
+------- |
|
| 108 |
+ |
|
| 109 |
+The actual value to use for ``NUMBER_FAKE_NOVA_COMPUTE`` depends on factors |
|
| 110 |
+such as: |
|
| 111 |
+ |
|
| 112 |
+* The size of the host (physical or virtualized) on which devstack is running. |
|
| 113 |
+* The number of API workers. By default, devstack will run ``max($nproc/2, 2)`` |
|
| 114 |
+ workers per API service. If you are running several fake compute services on |
|
| 115 |
+ a single host, then consider setting ``API_WORKERS=1`` in ``local.conf``. |
|
| 116 |
+ |
|
| 117 |
+In addition, while quota will be disabled in neutron, there is no fake ML2 |
|
| 118 |
+backend for neutron so creating fake VMs will still result in real ports being |
|
| 119 |
+created. To create servers without networking, you can specify ``--nic=none`` |
|
| 120 |
+when creating the server, for example: |
|
| 121 |
+ |
|
| 122 |
+.. code-block:: shell |
|
| 123 |
+ |
|
| 124 |
+ $ openstack --os-compute-api-version 2.37 server create --flavor cirros256 \ |
|
| 125 |
+ --image cirros-0.3.5-x86_64-disk --nic none --wait test-server |
|
| 126 |
+ |
|
| 127 |
+.. note:: ``--os-compute-api-version`` greater than or equal to 2.37 is |
|
| 128 |
+ required to use ``--nic=none``. |
|
| 129 |
+ |
|
| 130 |
+To avoid overhead from other services which you may not need, disable them in |
|
| 131 |
+your ``local.conf``, for example: |
|
| 132 |
+ |
|
| 133 |
+.. code-block:: ini |
|
| 134 |
+ |
|
| 135 |
+ disable_service horizon |
|
| 136 |
+ disable_service tempest |