nova/nova/tests/unit
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
..
accelerator smartnic support - reject server move and suspend 2021-08-05 15:58:41 +08:00
api Merge "Update quota apis with keystone limits and usage" 2022-02-27 04:01:49 +00:00
cmd Merge "Complete phase-1 of RBAC community-wide goal" 2022-02-27 04:50:13 +00:00
compute enable locking test fixture 2022-04-22 07:36:01 +00:00
conductor Enforce resource limits using oslo.limit 2022-02-24 16:21:03 +00:00
conf Expose the mdev class 2021-08-27 14:52:01 +01:00
console Merge "console: Improve logging" 2021-09-07 14:29:08 +00:00
db db: Don't rely on autocommit behavior 2022-04-08 15:57:06 +01:00
fake_loadables
fixtures Test the NotificationFixture 2021-06-10 18:07:47 +02:00
image Merge "Close Glance image if downloading failed." 2022-01-17 10:31:21 +00:00
keymgr
limit Follow up for unified limits 2022-03-04 03:42:58 +00:00
network Fix migration with remote-managed ports & add FT 2022-03-04 18:41:48 +03:00
notifications object/notification for Adds Pick guest CPU architecture based on host 2022-02-24 12:06:55 -05:00
objects db: Don't rely on autocommit behavior 2022-04-08 15:57:06 +01:00
pci objects: Remove 'NovaObjectDictCompat' from 'InstancePCIRequest' 2022-03-23 15:16:00 +00:00
policies Complete phase-1 of RBAC community-wide goal 2022-02-24 16:33:34 +00:00
privsep Retry lvm volume and volume group query 2021-06-15 12:39:26 +02:00
scheduler Merge "Tell oslo.limit how to count nova resources" 2022-02-26 23:44:52 +00:00
servicegroup
ssl_cert
storage Avoid modifying the Mock class in test 2021-08-23 17:36:00 +02:00
virt VMware: StableMoRefProxy for moref recovery 2022-04-29 08:14:39 +00:00
volume Add volume-rebuild support to cinder module 2022-02-25 02:12:55 +05:30
__init__.py
fake_block_device.py
fake_build_request.py
fake_console_auth_token.py
fake_crypto.py
fake_diagnostics.py
fake_flavor.py
fake_hosts.py
fake_instance.py Remove (almost) all references to 'instance_type' 2021-03-29 12:24:15 +01:00
fake_ldap.py Remove six.moves 2020-11-07 03:25:02 +00:00
fake_network.py db: Unify 'nova.db.api', 'nova.db.sqlalchemy.api' 2021-08-09 15:34:40 +01:00
fake_network_cache_model.py Use UUID as vif and network_id in vif tests 2020-09-07 10:31:52 +02:00
fake_pci_device_pools.py
fake_policy.py Separate flavor extra specs policy for server APIs 2022-02-24 16:33:26 +00:00
fake_processutils.py Remove six.binary_type/integer_types/string_types 2020-12-13 11:25:14 +00:00
fake_request_spec.py Reproduce bug 1952941 2021-12-03 09:08:15 +00:00
fake_requests.py
fake_server_actions.py db: Unify 'nova.db.api', 'nova.db.sqlalchemy.api' 2021-08-09 15:34:40 +01:00
fake_volume.py
image_fixtures.py
matchers.py Remove six.text_type (2/2) 2020-12-13 11:26:35 +00:00
test_api_validation.py api: Rename 'parameter_types.hostname' -> 'fqdn' 2021-08-19 11:16:59 +01:00
test_availability_zones.py db: Unify 'nova.db.api', 'nova.db.sqlalchemy.api' 2021-08-09 15:34:40 +01:00
test_baserpc.py
test_block_device.py fup: Remove unused legacy block_device_info format 2021-08-20 13:26:46 +01:00
test_cache.py
test_cinder.py
test_conf.py db: Post reshuffle cleanup 2021-08-09 15:34:40 +01:00
test_configdrive2.py
test_context.py Fix unit test for oslo.context 4.1.0 2022-02-28 12:36:37 -06:00
test_crypto.py Remove six.moves 2020-11-07 03:25:02 +00:00
test_exception.py rpc: Rework 'get_notifier', 'wrap_exception' 2021-03-01 11:06:48 +00:00
test_exception_wrapper.py Use NotificationFixture for legacy notifications too 2021-05-24 11:00:59 +01:00
test_fixtures.py Fix unit tests when they are run with OS_DEBUG=True 2022-03-23 10:31:04 +01:00
test_hacking.py hacking: Prevent use of six 2022-04-05 12:59:12 +01:00
test_identity.py Add autopep8 to tox and pre-commit 2021-11-08 12:37:27 +00:00
test_json_ref.py Remove six.moves 2020-11-07 03:25:02 +00:00
test_loadables.py
test_matchers.py
test_metadata.py Remove Python 2-specific imports 2022-01-28 12:27:06 +00:00
test_notifications.py objects: Remove 'bandwidth' fields from notifications 2021-11-03 17:33:43 +00:00
test_notifier.py
test_policy.py Complete phase-1 of RBAC community-wide goal 2022-02-24 16:33:34 +00:00
test_profiler.py Remove six.moves 2020-11-07 03:25:02 +00:00
test_quota.py Update quota apis with keystone limits and usage 2022-02-24 16:21:03 +00:00
test_rpc.py rpc: Rework 'get_notifier', 'wrap_exception' 2021-03-01 11:06:48 +00:00
test_safeutils.py
test_service.py Merge "Correct test error" 2022-02-21 20:58:07 +00:00
test_service_auth.py
test_test.py Add autopep8 to tox and pre-commit 2021-11-08 12:37:27 +00:00
test_test_utils.py db: Unify 'nova.db.api', 'nova.db.sqlalchemy.api' 2021-08-09 15:34:40 +01:00
test_utils.py Add autopep8 to tox and pre-commit 2021-11-08 12:37:27 +00:00
test_versions.py Change API unexpected exception message 2021-02-17 21:30:07 +00:00
test_weights.py
test_wsgi.py Remove six.PY2 and six.PY3 2020-08-15 07:45:23 +00:00
utils.py Add autopep8 to tox and pre-commit 2021-11-08 12:37:27 +00:00