3

I'm trying to set up openstack compute nodes that mimics a real node, however never actually sets up the VMs on a physical host. In the openstack tests, there are usages of fake drivers (defined in nova/virt/fake.py) through a complex system of testing classes.

I wish to get such a node up and running not within a test (meaning, I don't want to use these classes to spawn the compute node), but on an actual VM/container, however, I cannot figure out how to get a compute process to run with this fake hypervisor (or more specifically, one that will be defined by me).

How do I inject this fake driver instead of the real driver in a compute node?

(also, I'm installing OS using devstack (latest))

For more clarification, my goal is to do stress testing of OS, running multiple fake compute nodes, not in all-in-one configuration. The usage of devstack to setup the controller node is for simplifying the process, but the system should be:

  • A controller node, running the core services (Nova, Glance, Keystone etc.).
  • Multiple compute nodes, using fake hypervisors on different machines.
Kerek
  • 1,106
  • 1
  • 8
  • 18
  • The Devstack docs have a [section](https://docs.openstack.org/devstack/latest/guides/nova.html#fake-virt-driver) about this driver. – berndbausch May 25 '21 at 02:17
  • @berndbausch I have seen that, but I need to inject my own implementation of the fake driver. I'm not doing an API testing (as described there, and the reason the fake driver doesn't check the quotas). – Kerek May 25 '21 at 08:09
  • 1
    You could deploy Devstack with the fake driver as described, then replace `fake.py`with your code. – berndbausch May 25 '21 at 11:57
  • @berndbausch and if I want to deploy the compute node on a different server? (not all-in-one formation) – Kerek May 25 '21 at 12:39
  • 1
    A compute node can only have one hypervisor driver, but you can have heterogeneous hypervisors in the cloud. Therefore, install your `fake.py` on all those compute nodes where you want it. – berndbausch May 25 '21 at 13:44
  • @berndbausch it gave me the idea where to look for this option, added it below in an answer. Thanks! – Kerek May 25 '21 at 14:08

1 Answers1

0

When installing a new compute node, there is a configuration file nova-compute.conf that is being created automatically.

It seems that in /etc/nova/nova-compute.conf there is an option:

compute_driver = libvirt.LibvirtDriver

That uses libvirt as the default hypervisor for a compute node. In addition to hyperv, vmwareapi and xenapi, according to the nova configuration documentation, one can choose using the fake driver by changing this option to:

compute_driver = fake.FakeDriver

In order to set the fake driver to our implementation, we may replace the fake driver written in fake.py with something else.

Kerek
  • 1,106
  • 1
  • 8
  • 18