8.2. Flavor arguments

The openstack flavor create command has one positional argument, <flavor_name>, to specify the name of your new flavor.

The following table details the optional arguments that you can specify as required when you create a new flavor.

表8.2 Optional flavor arguments

Optional argumentDescription

--id

Unique ID for the flavor. The default value, auto, generates a UUID4 value. You can use this argument to manually specify an integer or UUID4 value.

--ram

(Mandatory) Size of memory to make available to the instance, in MB.

Default: 256 MB

--disk

(Mandatory) Amount of disk space to use for the root (/) partition, in GB. The root disk is an ephemeral disk that the base image is copied into. When an instance boots from a persistent volume, the root disk is not used.

注記

Creation of an instance with a flavor that has --disk set to 0 requires that the instance boots from volume.

Default: 0 GB

--ephemeral

Amount of disk space to use for the ephemeral disks, in GB. Defaults to 0 GB, which means that no secondary ephemeral disk is created. Ephemeral disks offer machine local disk storage linked to the lifecycle of the instance. Ephemeral disks are not included in any snapshots. This disk is destroyed and all data is lost when the instance is deleted.

Default: 0 GB

--swap

Swap disk size in MB.

Default: 0 GB

--vcpus

(Mandatory) Number of virtual CPUs for the instance.

Default: 1

--public

The flavor is available to all projects. By default, a flavor is public and available to all projects.

--private

The flavor is only available to the projects specified by using the --project option. If you create a private flavor but add no projects to it then the flavor is only available to the cloud administrator.

--property

Metadata, or "extra specs", specified by using key-value pairs in the following format:

--property <key=value>

Repeat this option to set multiple properties.

--project

Specifies the project that can use the private flavor. You must use this argument with the --private option. If you do not specify any projects, the flavor is visible only to the admin user.

Repeat this option to allow access to multiple projects.

--project-domain

Specifies the project domain that can use the private flavor. You must use this argument with the --private option.

Repeat this option to allow access to multiple project domains.

--description

Description of the flavor. Limited to 65535 characters in length. You can use only printable characters.