Command Line Reference

Command Line Reference

allocation candidate list

List allocation candidates.

Returns a representation of a collection of allocation requests and resource provider summaries. Each allocation request has information to issue an “openstack resource provider allocation set” request to claim resources against a related set of resource providers.

As several allocation requests are available its necessary to select one. To make a decision, resource provider summaries are provided with the inventory/capacity information.

For example:

$ export OS_PLACEMENT_API_VERSION=1.10
$ openstack allocation candidate list --resource VCPU=1
+---+------------+-------------------------+-------------------------+
| # | allocation | resource provider       | inventory used/capacity |
+---+------------+-------------------------+-------------------------+
| 1 | VCPU=1     | 66bcaca9-9263-45b1-a569 | VCPU=0/128              |
|   |            | -ea708ff7a968           |                         |
+---+------------+-------------------------+-------------------------+

In this case, the user is looking for resource providers that can have capacity to allocate 1 VCPU resource class. There is one resource provider that can serve that allocation request and that resource providers current VCPU inventory used is 0 and available capacity is 128.

This command requires at least --os-placement-api-version 1.10.

openstack allocation candidate list
    [--sort-column SORT_COLUMN]
    [--resource <resource_class>=<value>]
    [--limit <limit>]
    [--required <required>]
    [--aggregate-uuid <aggregate_uuid>]
--sort-column SORT_COLUMN

specify the column(s) to sort the data (columns specified first have a priority, non-existing columns are ignored), can be repeated

--resource <resource_class>=<value>

String indicating an amount of resource of a specified class that providers in each allocation request must collectively have the capacity and availability to serve. Can be specified multiple times per resource class. For example: --resource VCP=4 --resource DISK_GB=64 --resource MEMORY_MB=2048

--limit <limit>

A positive integer to limit the maximum number of allocation candidates. This option requires at least --os-placement-api-version 1.16.

--required <required>

A required trait. May be repeated. Allocation candidates must collectively contain all of the required traits. This option requires at least --os-placement-api-version 1.17.

--aggregate-uuid <aggregate_uuid>

UUID of the resource provider aggregate of which the returned allocation candidates are a member. The returned allocation candidates must be associated with at least one of the aggregates identified by uuid. May be repeated.

This param requires at least --os-placement-api-version 1.21.

This command is provided by the osc-placement plugin.

resource class create

Create a new resource class.

This command requires at least –os-placement-api-version 1.2.

openstack resource class create <name>
name

Name of the resource class

This command is provided by the osc-placement plugin.

resource class delete

Delete the resource class identified by {name}.

Only custom resource classes can be deleted.

This command requires at least –os-placement-api-version 1.2.

openstack resource class delete <name>
name

Name of the resource class

This command is provided by the osc-placement plugin.

resource class list

Return a list of all resource classes.

This command requires at least –os-placement-api-version 1.2.

openstack resource class list [--sort-column SORT_COLUMN]
--sort-column SORT_COLUMN

specify the column(s) to sort the data (columns specified first have a priority, non-existing columns are ignored), can be repeated

This command is provided by the osc-placement plugin.

resource class set

Create or validate the existence of single resource class.

Unlike “resource class create” also succeed if the resource class already exists, which makes this an idempotent check or create command.

This command requires at least --os-placement-api-version 1.7.

openstack resource class set <name>
name

Name of the resource class

This command is provided by the osc-placement plugin.

resource class show

Return a representation of the resource class identified by {name}.

This command requires at least –os-placement-api-version 1.2.

openstack resource class show <name>
name

Name of the resource class

This command is provided by the osc-placement plugin.

resource provider aggregate list

List resource provider aggregates.

This command requires at least –os-placement-api-version 1.1.

openstack resource provider aggregate list
    [--sort-column SORT_COLUMN]
    <uuid>
--sort-column SORT_COLUMN

specify the column(s) to sort the data (columns specified first have a priority, non-existing columns are ignored), can be repeated

uuid

UUID of the resource provider

This command is provided by the osc-placement plugin.

resource provider aggregate set

Associate a list of aggregates with the resource provider.

Each request cleans up previously associated resource provider aggregates entirely and sets the new ones. Passing empty aggregate UUID list will remove all associations with aggregates for the particular resource provider.

This command requires at least –os-placement-api-version 1.1.

openstack resource provider aggregate set
    [--sort-column SORT_COLUMN]
    [--aggregate <aggregate_uuid>]
    [--generation <resource_provider_generation>]
    <uuid>
--sort-column SORT_COLUMN

specify the column(s) to sort the data (columns specified first have a priority, non-existing columns are ignored), can be repeated

--aggregate <aggregate_uuid>

UUID of the aggregate. Specify multiple times to associate a resource provider with multiple aggregates.

--generation <resource_provider_generation>

The generation of resource provider. Must match the server-side generation of the resource provider or the operation will fail.

This param requires at least --os-placement-api-version 1.19.

uuid

UUID of the resource provider

This command is provided by the osc-placement plugin.

resource provider allocation delete

Delete all resource allocations for a given consumer.

openstack resource provider allocation delete <uuid>
uuid

UUID of the consumer

This command is provided by the osc-placement plugin.

resource provider allocation set

Replaces the set of resource allocation(s) for a given consumer.

Note that this is a full replacement of the existing allocations. If you want to retain the existing allocations and add a new resource class allocation, you must specify all resource class allocations, old and new.

From --os-placement-api-version 1.8 it is required to specify --project-id and --user-id to set allocations. It is highly recommended to provide a --project-id and --user-id when setting allocations for accounting and data consistency reasons.

Starting with --os-placement-api-version 1.12 the API response contains the project_id and user_id of allocations which also appears in the CLI output.

openstack resource provider allocation set
    [--sort-column SORT_COLUMN]
    [--allocation <rp=resource-provider-id,resource-class-name=amount-of-resource-used>]
    [--project-id project_id]
    [--user-id user_id]
    <uuid>
--sort-column SORT_COLUMN

specify the column(s) to sort the data (columns specified first have a priority, non-existing columns are ignored), can be repeated

--allocation <rp=resource-provider-id,resource-class-name=amount-of-resource-used>

Create (or update) an allocation of a resource class. Specify option multiple times to set multiple allocations.

--project-id project_id

ID of the consuming project. This option is required starting from --os-placement-api-version 1.8.

--user-id user_id

ID of the consuming user. This option is required starting from --os-placement-api-version 1.8.

uuid

UUID of the consumer

This command is provided by the osc-placement plugin.

resource provider allocation show

Show resource allocations for a given consumer.

Starting with --os-placement-api-version 1.12 the API response contains the project_id and user_id of allocations which also appears in the CLI output.

openstack resource provider allocation show
    [--sort-column SORT_COLUMN]
    <uuid>
--sort-column SORT_COLUMN

specify the column(s) to sort the data (columns specified first have a priority, non-existing columns are ignored), can be repeated

uuid

UUID of the consumer

This command is provided by the osc-placement plugin.

resource provider create

Create a new resource provider

openstack resource provider create
    [--parent-provider <parent_provider>]
    [--uuid <uuid>]
    <name>
--parent-provider <parent_provider>

UUID of the parent provider. Omit for no parent. This option requires at least --os-placement-api-version 1.14.

--uuid <uuid>

UUID of the resource provider

name

Name of the resource provider

This command is provided by the osc-placement plugin.

resource provider delete

Delete a resource provider

openstack resource provider delete <uuid>
uuid

UUID of the resource provider

This command is provided by the osc-placement plugin.

resource provider inventory class set

Replace the inventory record of the class for the resource provider.

Example: openstack resource provider inventory class set <uuid> VCPU –total 16 –max_unit 4 –reserved 1

openstack resource provider inventory class set
    [--allocation_ratio <allocation_ratio>]
    [--min_unit <min_unit>]
    [--max_unit <max_unit>]
    [--reserved <reserved>]
    [--step_size <step_size>]
    --total <total>
    <uuid>
    <class>
--allocation_ratio <allocation_ratio>

It is used in determining whether consumption of the resource of the provider can exceed physical constraints. For example, for a vCPU resource with: allocation_ratio = 16.0, total = 8. Overall capacity is equal to 128 vCPUs.

--min_unit <min_unit>

A minimum amount any single allocation against an inventory can have.

--max_unit <max_unit>

A maximum amount any single allocation against an inventory can have.

--reserved <reserved>

The amount of the resource a provider has reserved for its own use.

--step_size <step_size>

A representation of the divisible amount of the resource that may be requested. For example, step_size = 5 means that only values divisible by 5 (5, 10, 15, etc.) can be requested.

--total <total>

The actual amount of the resource that the provider can accommodate.

uuid

UUID of the resource provider

class

<resource_class> is an entity that indicates standard or deployer-specific resources that can be provided by a resource provider. For example, VCPU, MEMORY_MB, DISK_GB.

This command is provided by the osc-placement plugin.

resource provider inventory delete

Delete the inventory.

Depending on the resource class argument presence, it can delete all inventory for a given resource provider or for a resource provider/class pair.

Delete all inventories for given resource provider requires at least --os-placement-api-version 1.5.

openstack resource provider inventory delete
    --resource-class <resource_class>
    <uuid>
--resource-class <resource_class>

<resource_class> is an entity that indicates standard or deployer-specific resources that can be provided by a resource provider. For example, VCPU, MEMORY_MB, DISK_GB. This argument can be omitted starting with --os-placement-api-version 1.5. If it is omitted all inventories of the specified resource provider will be deleted.

uuid

UUID of the resource provider

This command is provided by the osc-placement plugin.

resource provider inventory list

List inventories for a given resource provider.

openstack resource provider inventory list
    [--sort-column SORT_COLUMN]
    <uuid>
--sort-column SORT_COLUMN

specify the column(s) to sort the data (columns specified first have a priority, non-existing columns are ignored), can be repeated

uuid

UUID of the resource provider

This command is provided by the osc-placement plugin.

resource provider inventory set

Replaces the set of inventory records for the resource provider.

Note that this is a full replacement of the existing inventory. If you want to retain the existing inventory and add a new resource class inventory, you must specify all resource class inventory, old and new.

If a specific inventory field is not specified for a given resource class, it is assumed to be the total, i.e. –resource VCPU=16 is equivalent to –resource VCPU:total=16.

Example: openstack resource provider inventory set <uuid> –resource VCPU=16 –resource MEMORY_MB=2048 –resource MEMORY_MB:step_size=128

openstack resource provider inventory set
    [--sort-column SORT_COLUMN]
    [--resource <resource_class>:<inventory_field>=<value>]
    <uuid>
--sort-column SORT_COLUMN

specify the column(s) to sort the data (columns specified first have a priority, non-existing columns are ignored), can be repeated

--resource <resource_class>:<inventory_field>=<value>

String describing resource. <resource_class> is an entity that indicates standard or deployer-specific resources that can be provided by a resource provider. For example, VCPU, MEMORY_MB, DISK_GB. <inventory_field> (optional) can be: allocation_ratio - it is used in determining whether consumption of the resource of the provider can exceed physical constraints. for example, for a vcpu resource with: allocation_ratio = 16.0, total = 8. overall capacity is equal to 128 vcpus. min_unit - a minimum amount any single allocation against an inventory can have. max_unit - a maximum amount any single allocation against an inventory can have. reserved - the amount of the resource a provider has reserved for its own use. step_size - a representation of the divisible amount of the resource that may be requested. for example, step_size = 5 means that only values divisible by 5 (5, 10, 15, etc.) can be requested. total - the actual amount of the resource that the provider can accommodate.

uuid

UUID of the resource provider

This command is provided by the osc-placement plugin.

resource provider inventory show

Show the inventory for a given resource provider/class pair.

openstack resource provider inventory show <uuid> <resource_class>
uuid

UUID of the resource provider

resource_class

<resource_class> is an entity that indicates standard or deployer-specific resources that can be provided by a resource provider. For example, VCPU, MEMORY_MB, DISK_GB.

This command is provided by the osc-placement plugin.

resource provider list

List resource providers

openstack resource provider list
    [--sort-column SORT_COLUMN]
    [--uuid <uuid>]
    [--name <name>]
    [--aggregate-uuid <aggregate_uuid>]
    [--resource <resource_class>=<value>]
    [--in-tree <in_tree>]
    [--required <required>]
--sort-column SORT_COLUMN

specify the column(s) to sort the data (columns specified first have a priority, non-existing columns are ignored), can be repeated

--uuid <uuid>

UUID of the resource provider

--name <name>

Name of the resource provider

--aggregate-uuid <aggregate_uuid>

UUID of the resource provider aggregate of which the listed resource providers are a member. The returned resource providers must be associated with at least one of the aggregates identified by uuid. May be repeated.

This param requires at least --os-placement-api-version 1.3.

--resource <resource_class>=<value>

A resource class value pair indicating an amount of resource of a specified class that a provider must have the capacity to serve. May be repeated.

This param requires at least --os-placement-api-version 1.4.

--in-tree <in_tree>

Restrict listing to the same “provider tree” as the specified provider UUID. This option requires at least --os-placement-api-version 1.14.

--required <required>

A required trait. May be repeated. Resource providers must collectively contain all of the required traits. This option requires at least --os-placement-api-version 1.18.

This command is provided by the osc-placement plugin.

resource provider set

Update an existing resource provider

openstack resource provider set
    --name <name>
    [--parent-provider <parent_provider>]
    <uuid>
--name <name>

A new name of the resource provider

--parent-provider <parent_provider>

UUID of the parent provider. Can only be set if the resource provider has no parent yet. This option requires at least --os-placement-api-version 1.14.

uuid

UUID of the resource provider

This command is provided by the osc-placement plugin.

resource provider show

Show resource provider details

openstack resource provider show [--allocations] <uuid>
--allocations

include the info on allocations of the provider resources

uuid

UUID of the resource provider

This command is provided by the osc-placement plugin.

resource provider trait delete

Dissociate all the traits from the resource provider.

Note that this command is not atomic if multiple processes are managing traits for the same provider.

This command requires at least --os-placement-api-version 1.6.

openstack resource provider trait delete <uuid>
uuid

UUID of the resource provider.

This command is provided by the osc-placement plugin.

resource provider trait list

List traits associated with the resource provider identified by {uuid}.

This command requires at least --os-placement-api-version 1.6.

openstack resource provider trait list
    [--sort-column SORT_COLUMN]
    <uuid>
--sort-column SORT_COLUMN

specify the column(s) to sort the data (columns specified first have a priority, non-existing columns are ignored), can be repeated

uuid

UUID of the resource provider.

This command is provided by the osc-placement plugin.

resource provider trait set

Associate traits with the resource provider identified by {uuid}.

All the associated traits will be replaced by the traits specified.

This command requires at least --os-placement-api-version 1.6.

openstack resource provider trait set
    [--sort-column SORT_COLUMN]
    [--trait <trait>]
    <uuid>
--sort-column SORT_COLUMN

specify the column(s) to sort the data (columns specified first have a priority, non-existing columns are ignored), can be repeated

--trait <trait>

Name of the trait. May be repeated.

uuid

UUID of the resource provider.

This command is provided by the osc-placement plugin.

resource provider usage show

Show resource usages per class for a given resource provider.

openstack resource provider usage show
    [--sort-column SORT_COLUMN]
    <uuid>
--sort-column SORT_COLUMN

specify the column(s) to sort the data (columns specified first have a priority, non-existing columns are ignored), can be repeated

uuid

UUID of the resource provider

This command is provided by the osc-placement plugin.

resource usage show

Show resource usages for a project (and optionally user) per class.

Gives a report of usage information for resources associated with the project identified by the project_id argument and user identified by the --user-id option.

This command requires at least --os-placement-api-version 1.9.

openstack resource usage show
    [--sort-column SORT_COLUMN]
    [--user-id <user-uuid>]
    <project-uuid>
--sort-column SORT_COLUMN

specify the column(s) to sort the data (columns specified first have a priority, non-existing columns are ignored), can be repeated

--user-id <user-uuid>

ID of the user.

project-uuid

ID of the project.

This command is provided by the osc-placement plugin.

trait create

Create a new custom trait.

Custom traits must begin with the prefix CUSTOM_ and contain only the letters A through Z, the numbers 0 through 9 and the underscore “_” character.

This command requires at least --os-placement-api-version 1.6.

openstack trait create <name>
name

Name of the trait.

This command is provided by the osc-placement plugin.

trait delete

Delete the trait specified by {name}.

This command requires at least --os-placement-api-version 1.6.

openstack trait delete <name>
name

Name of the trait.

This command is provided by the osc-placement plugin.

trait list

Return a list of valid trait strings.

This command requires at least --os-placement-api-version 1.6.

openstack trait list
    [--sort-column SORT_COLUMN]
    [--name <name>]
    [--associated]
--sort-column SORT_COLUMN

specify the column(s) to sort the data (columns specified first have a priority, non-existing columns are ignored), can be repeated

--name <name>

A string to filter traits. The following options are available: startswith operator filters the traits whose name begins with a specific prefix, e.g. name=startswith:CUSTOM, in operator filters the traits whose name is in the specified list, e.g. name=in:HW_CPU_X86_AVX,HW_CPU_X86_SSE, HW_CPU_X86_INVALID_FEATURE.

--associated

If this parameter is presented, the returned traits will be those that are associated with at least one resource provider.

This command is provided by the osc-placement plugin.

trait show

Check if a trait name exists in this cloud.

This command requires at least --os-placement-api-version 1.6.

openstack trait show <name>
name

Name of the trait.

This command is provided by the osc-placement plugin.

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.