Use the viocli inventory-admin command to compare the compute and block storage inventories against the vSphere inventory and to discover and remove orphaned objects.

Orphaned objects are defined as follows:

  • Orphaned Nova instances are those for which a corresponding virtual machine does not exist in vSphere.

  • Orphaned virtual machines are those for which a corresponding instance does not exist in the OpenStack database.

  • Orphaned shadow virtual machines are those for which a corresponding Cinder volume does not exist in the OpenStack database.

The viocli inventory-admin command collects vCenter Server and OpenStack credentials from internal inventories. This command requires that you authenticate as an OpenStack administrator. The domain and user name of this account are set in /root/cloudadmin.rc as the OS_PROJECT_DOMAIN_NAME, OS_USERNAME, and OS_USER_DOMAIN_NAME variables. You can also set the password for this account as the OS_PASSWORD environment variable to avoid entering this password every time you run the command.

The viocli inventory-admin command supports a variety of actions to perform different tasks. The following parameters apply to all actions.

Parameter

Mandatory or Optional

Description

-d NAME or --deployment NAME

Optional

Name of the deployment to use.

If you do not enter a value, the default deployment is used.

--json

--pretty

Optional

Displays output in JSON format or as formatted text.

If you do not enter a value, --pretty is used when the command is run interactively and --json is used when the command is run noninteractively.

--all

Optional

Shows all objects instead of only orphaned objects.

--force

Optional

Runs the command without prompting for confirmation.

--no-grace-period

Optional

Ignores the grace period when determining whether objects are orphaned. Objects modified in the past 30 minutes are included in the results only when this parameter is set.

--verbose

Optional

Displays output in verbose mode.

You can run viocli inventory-admin -h or viocli inventory-admin --help to display the parameters for the command. You can also use the -h or --help option on any action to display parameters for the action. For example, viocli inventory-admin show-instances -h will show parameters for the show-instances action.

The actions that viocli inventory-admin supports are listed as follows.

viocli inventory-admin show-instances [-d NAME] [--json | --pretty] [--all] [--force] [--no-grace-period] [--verbose]

Lists orphaned Nova instances.

 

viocli inventory-admin show-instance-vms [-d NAME] [--json | --pretty] [--all] [--force] [--no-grace-period] [--verbose]

Lists orphaned vSphere virtual machines.

 

viocli inventory-admin show-shadow-vms [-d NAME] [--json | --pretty] [--all] [--force] [--no-grace-period] [--verbose]

Lists orphaned shadow virtual machines.

 

viocli inventory-admin clean-instances [-d NAME] [--json | --pretty] [--all] [--force] [--no-grace-period] [--verbose]

Removes orphaned vSphere virtual machines.

 

viocli inventory-admin clean-instance-vms [-d NAME] [--json | --pretty] [--all] [--force] [--no-grace-period] [--verbose]

Removes orphaned vSphere virtual machines.

 

viocli inventory-admin clean-shadow-vms [-d NAME] [--json | --pretty] [--all] [--force] [--no-grace-period] [--verbose]

Removes orphaned shadow virtual machines.

 

viocli inventory-admin show-hypervisors [-d NAME] [--json | --pretty] [--all] [--force] [--no-grace-period] [--verbose]

Lists hypervisors with detailed information.

 

viocli inventory-admin show-availability-zones [-d NAME] [--json | --pretty] [--all] [--force] [--no-grace-period] [--verbose]

Lists availability zones and the hosts located in them.

 

viocli inventory-admin sync-availability-zones [-d NAME] [--filename ZONE-MAP] [--json | --pretty] [--all] [--force] [--no-grace-period] [--verbose]

Synchronizes the availability zones in the environment with the specified map. The following additional parameters are supported.

Parameter

Mandatory or Optional

Description

--filename ZONE-MAP

Optional

Path to the file containing the availability zone map. The file must be in JSON format.

 

viocli inventory-admin create-tenant-vdc [-d NAME] --compute COMPUTE-NODE --name VDC-NAME --project-id ID [--cpu-reserve CPU] [--cpu-limit CPU-LIMIT] [--cpu-shares CPU-SHARES] [--mem-reserve MEMORY] [--mem-limit MEM-LIMIT] [--mem-shares MEM-SHARES] [--json | --pretty] [--all] [--force] [--no-grace-period] [--verbose]

Create a tenant virtual data center (VDC) with the specified settings. The following additional parameters are supported.

Parameter

Mandatory or Optional

Description

--compute COMPUTE-NODE

Mandatory

Compute node on which to create the VDC.

--name VDC-NAME

Mandatory

Name of the tenant VDC.

--project-id ID

Mandatory

Project ID for the task.

--cpu-reserve CPU

Optional

CPU cycles to reserve for the VDC.

If you do not enter a value, 0 is used by default.

--cpu-limit CPU-LIMIT

Optional

Maximum limit for CPU usage on the VDC.

If you do not enter a value, CPU usage is not limited.

--cpu-shares CPU-SHARES

Optional

Value for the CPU shares.

You can enter high, medium, low, or an integer.

--mem-reserve MEMORY

Optional

Memory to reserve for the VDC.

If you do not enter a value, 0 is used by default.

--mem-limit MEM-LIMIT

Optional

Maximum limit for memory consumption on the VDC.

If you do not enter a value, memory consumption is not limited.

--mem-shares MEM-SHARES

Optional

Value for the memory shares.

You can enter high, medium, low, or an integer.

 

viocli inventory-admin list-tenant-vdcs [-d NAME] [--json | --pretty] [--all] [--force] [--no-grace-period] [--verbose]

Lists tenant VDCs.

 

viocli inventory-admin show-tenant-vdc [-d NAME] --id ID [--json | --pretty] [--all] [--force] [--no-grace-period] [--verbose]

Displays detailed information about the specified tenant VDC. The following additional parameters are supported.

Parameter

Mandatory or Optional

Description

--id ID

Mandatory

Identifier of a tenant VDC.

 

viocli inventory-admin delete-tenant-vdc [-d NAME] --id ID [--json | --pretty] [--all] [--force] [--no-grace-period] [--verbose]

Deletes the specified tenant VDC. The following additional parameters are supported.

Parameter

Mandatory or Optional

Description

--id ID

Mandatory

Identifier of a tenant VDC.

 

viocli inventory-admin update-tenant-vdc [-d NAME] --compute COMPUTE-NODE --name VDC-NAME --project-id ID [--cpu-reserve CPU] [--cpu-limit CPU-LIMIT] [--cpu-shares CPU-SHARES] [--mem-reserve MEMORY] [--mem-limit MEM-LIMIT] [--mem-shares MEM-SHARES] [--json | --pretty] [--all] [--force] [--no-grace-period] [--verbose]

Updates the configuration of the specified tenant VDC. The following additional parameters are supported.

Parameter

Mandatory or Optional

Description

--compute COMPUTE-NODE

Mandatory

Compute node on which the VDC is running.

--id VDC-ID

Mandatory

Identifier of the tenant VDC.

--cpu-reserve CPU

Optional

CPU cycles to reserve for the VDC.

--cpu-limit CPU-LIMIT

Optional

Maximum limit for CPU usage on the VDC.

The value -1 indicates that CPU usage is not limited.

--cpu-shares CPU-SHARES

Optional

Value for the CPU shares.

You can enter high, medium, low, or an integer.

--mem-reserve MEMORY

Optional

Memory to reserve for the VDC.

--mem-limit MEM-LIMIT

Optional

Maximum limit for memory consumption on the VDC.

The value -1 indicates that memory usage is not limited.

--mem-shares MEM-SHARES

Optional

Value for the memory shares.

You can enter high, medium, low, or an integer.