nova/nova/tests/unit/virt
Fabian Wiesel 56055ede03 VMware: StableMoRefProxy for moref recovery
The vmwareapi driver uses Managed-Object references throughout the code
with the assumption that they are stable. It is however a database id,
which may change during the runtime of the compute node. e.g. If an
instance is unregistered and re-registerd in the vcenter, the moref will
change. By wrapping a moref in a proxy object, with an additional method
to resolve the openstack object to a moref, we can hide those changes
from a caller.

MoRef implementation with closure - should ease the transition to stable
mo-refs One simply has to pass the search function as a closure to the
MoRef instance, and the very same method will be called when an
exception is raised for the stored reference.

Stable Volume refs - The connection_info['data'] contains the
managed-object reference (moref) as well as the uuid of the volume.
When the moref become invalid for some reason, we can recover it by
searching for the volume-uuid as the `config.instanceUuid` attribute
of the shadow-vm.

Stable VM Ref - By encapsulating all the parameters for searching for
the vm-ref again, we can move the retry logic to the session object,
where we can try to recover the vm-ref should it result in a
ManagedObjectNotFound exception.

Use refs as index for fakedb -  It was previously using the object-id
to lookup an object, meaning that you couldn't pass a newly created
Managed-object-reference like you could over the vmware-api. Now the
lookup happens over the ref-id string, and in turn some functions
were refactored to take that into account.

Partial-Bug: #1962771

Change-Id: I2a3ddf95b7fe07630855b06e732f8764efb13e91
2022-04-29 08:14:39 +00:00
..
disk guestfs: With libguestfs >= v1.41.1 decode returned bytes to string 2021-04-23 14:02:35 +01:00
hyperv Move optional build dependencies to 'extras' 2022-01-28 12:27:06 +00:00
image
ironic Ignore plug_vifs on the ironic driver 2021-11-03 05:57:08 -07:00
libvirt Fix the PCI device capability dict creation 2022-03-15 21:32:54 +03:00
powervm Move optional build dependencies to 'extras' 2022-01-28 12:27:06 +00:00
vmwareapi VMware: StableMoRefProxy for moref recovery 2022-04-29 08:14:39 +00:00
zvm Move optional build dependencies to 'extras' 2022-01-28 12:27:06 +00:00
__init__.py
fakelibosinfo.py Stop sending bad values from libosinfo to libvirt 2019-07-04 15:30:51 +01:00
test_block_device.py enable locking test fixture 2022-04-22 07:36:01 +00:00
test_configdrive.py image_meta: Provide image_ref as the id when fetching from instance 2021-05-20 16:57:24 +01:00
test_events.py
test_fake.py
test_hardware.py Merge "Fix to implement 'pack' or 'spread' VM's NUMA cells" 2022-02-17 20:28:04 +00:00
test_imagecache.py Include removal of ephemeral backing files in the image cache manager 2020-10-09 12:24:06 +01:00
test_images.py Remove six.text_type (2/2) 2020-12-13 11:26:35 +00:00
test_netutils.py
test_osinfo.py Stop sending bad values from libosinfo to libvirt 2019-07-04 15:30:51 +01:00
test_virt.py Remove six.text_type (2/2) 2020-12-13 11:26:35 +00:00
test_virt_drivers.py Add autopep8 to tox and pre-commit 2021-11-08 12:37:27 +00:00