Updated openstack/openstack
Project: openstack/nova  2cb24c24cee634263c404b49f165067b5dd44d6e
null
VMware: optimize instance reference access

Fix bug causing nova-compute CPU to spike to 100%.

When there are hundreds of VMs running each time a VM is referenced
all of the VMs in the system will be read by nova-compute and then
filtered according to the UUID.

This is addressed by using an API (FindAllByUuid) which reads only
the specific VM. When a VM is created the config spec will be updated
with the UUID of the VM - that is, the field 'instanceUuid' will be
set. The search is later done on this field.

If the search fails then the old code will be invoked - this ensures
backward compatibility with running VM's. Thus all VM's created
without the 'instanceUuid' set will not be affected.

In addition to optimizing the search we also cache the VM reference.
This ensures that additional calls for the specific VM do not need
to query the backend for the reference.

Change-Id: I00d6c29f46b06d082cf3af0369a69147a3376341
Closes-bug: #1258179