Use the viocli inventory-admin command to compare the compute and block storage inventories against the vSphere inventory, discover and remove orphaned objects, and manage tenant virtual data centers.

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.

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]

Lists orphaned Nova instances.

 

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

Lists orphaned vSphere virtual machines.

 

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

Lists orphaned shadow virtual machines.

 

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

Removes orphaned vSphere virtual machines.

 

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

Removes orphaned vSphere virtual machines.

 

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

Removes orphaned shadow virtual machines.

 

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

Lists hypervisors with detailed information.

 

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

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]

Synchronizes the availability zones in the environment with the specified map. The following additional parameters apply to the sync-availability-zones action.

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-MAX] [--cpu-limit CPU-MIN] [--mem-reserve MEMORY-MAX] [--mem-limit MEMORY-MIN] [--json | --pretty] [--all] [--force] [--no-grace-period]

Create a tenant virtual data center (VDC) with the specified settings. The following additional parameters apply to the create-tenant-vdc action.

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-MIN

Optional

CPU cycles in MHz to reserve for the VDC.

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

--cpu-limit CPU-MAX

Optional

Maximum limit for CPU usage on the VDC (in MHz).

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

--mem-reserve MEMORY-MIN

Optional

Memory in megabytes to reserve for the VDC.

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

--mem-limit MEMORY-MAX

Optional

Maximum limit for memory consumption on the VDC (in megabytes).

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

 

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

Lists tenant VDCs.

 

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

Displays detailed information about the specified tenant VDC. The following additional parameters apply to the show-tenant-vdc action.

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]

Deletes the specified tenant VDC. The following additional parameters apply to the delete-tenant-vdc action.

Parameter Mandatory or Optional Description

--id ID

Mandatory

Identifier of a tenant VDC.