You can use the nova-manage command for cleaning the stale resource providers and traits for vGPU.

For more information about configuring vGPU, see NVIDIA GRID vGPU.

If you remove an ESXi host from compute node, some stale resource providers and traits can still be present in the placement database. The presence of these stale resource providers and traits can cause instance creation failure. So, use the nova-manage command for cleaning the stale resources and traits.

Note: If you have instances created with the vGPU profile, you cannot delete the associated resource providers and the traits.

Procedure

  1. Before removing the ESXi host, record the moid of the ESXi host.
  2. Log in to the nova-osapi pod.
    osctl exec -it nova-api-osapi-5c786c7469-5z4jh bash

    compute-13350e6f-c17 is the name of the compute node.

    host -15757 is the moid of the removed ESXi host.

  3. Run the nova-manage command.
    nova-manage placement purge_stale_trait_and_provider --host compute-13350e6f-c17 --esxi host-15757 --fix true

    If you do not specify the --fix true parameter, the command can only list the resource providers. Otherwise, you can delete the listed resource providers.

Results

After applying the nova-manage command, you can see that there are no stale resource providers, and traits present in the placement database.