openstack logo
OpenStack v3.12.1, Mar 23 23

openstack.compute.Flavor

Explore with Pulumi AI

Manages a V2 flavor resource within OpenStack.

Example Usage

using System.Collections.Generic;
using Pulumi;
using OpenStack = Pulumi.OpenStack;

return await Deployment.RunAsync(() => 
{
    var test_flavor = new OpenStack.Compute.Flavor("test-flavor", new()
    {
        Disk = 20,
        ExtraSpecs = 
        {
            { "hw:cpu_policy", "CPU-POLICY" },
            { "hw:cpu_thread_policy", "CPU-THREAD-POLICY" },
        },
        Ram = 8096,
        Vcpus = 2,
    });

});
package main

import (
	"github.com/pulumi/pulumi-openstack/sdk/v3/go/openstack/compute"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := compute.NewFlavor(ctx, "test-flavor", &compute.FlavorArgs{
			Disk: pulumi.Int(20),
			ExtraSpecs: pulumi.AnyMap{
				"hw:cpu_policy":        pulumi.Any("CPU-POLICY"),
				"hw:cpu_thread_policy": pulumi.Any("CPU-THREAD-POLICY"),
			},
			Ram:   pulumi.Int(8096),
			Vcpus: pulumi.Int(2),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.openstack.compute.Flavor;
import com.pulumi.openstack.compute.FlavorArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var test_flavor = new Flavor("test-flavor", FlavorArgs.builder()        
            .disk("20")
            .extraSpecs(Map.ofEntries(
                Map.entry("hw:cpu_policy", "CPU-POLICY"),
                Map.entry("hw:cpu_thread_policy", "CPU-THREAD-POLICY")
            ))
            .ram("8096")
            .vcpus("2")
            .build());

    }
}
import pulumi
import pulumi_openstack as openstack

test_flavor = openstack.compute.Flavor("test-flavor",
    disk=20,
    extra_specs={
        "hw:cpu_policy": "CPU-POLICY",
        "hw:cpu_thread_policy": "CPU-THREAD-POLICY",
    },
    ram=8096,
    vcpus=2)
import * as pulumi from "@pulumi/pulumi";
import * as openstack from "@pulumi/openstack";

const test_flavor = new openstack.compute.Flavor("test-flavor", {
    disk: 20,
    extraSpecs: {
        "hw:cpu_policy": "CPU-POLICY",
        "hw:cpu_thread_policy": "CPU-THREAD-POLICY",
    },
    ram: 8096,
    vcpus: 2,
});
resources:
  test-flavor:
    type: openstack:compute:Flavor
    properties:
      disk: '20'
      extraSpecs:
        hw:cpu_policy: CPU-POLICY
        hw:cpu_thread_policy: CPU-THREAD-POLICY
      ram: '8096'
      vcpus: '2'

Create Flavor Resource

new Flavor(name: string, args: FlavorArgs, opts?: CustomResourceOptions);
@overload
def Flavor(resource_name: str,
           opts: Optional[ResourceOptions] = None,
           description: Optional[str] = None,
           disk: Optional[int] = None,
           ephemeral: Optional[int] = None,
           extra_specs: Optional[Mapping[str, Any]] = None,
           flavor_id: Optional[str] = None,
           is_public: Optional[bool] = None,
           name: Optional[str] = None,
           ram: Optional[int] = None,
           region: Optional[str] = None,
           rx_tx_factor: Optional[float] = None,
           swap: Optional[int] = None,
           vcpus: Optional[int] = None)
@overload
def Flavor(resource_name: str,
           args: FlavorArgs,
           opts: Optional[ResourceOptions] = None)
func NewFlavor(ctx *Context, name string, args FlavorArgs, opts ...ResourceOption) (*Flavor, error)
public Flavor(string name, FlavorArgs args, CustomResourceOptions? opts = null)
public Flavor(String name, FlavorArgs args)
public Flavor(String name, FlavorArgs args, CustomResourceOptions options)
type: openstack:compute:Flavor
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args FlavorArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args FlavorArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args FlavorArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args FlavorArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args FlavorArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Flavor Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The Flavor resource accepts the following input properties:

Disk int

The amount of disk space in GiB to use for the root (/) partition. Changing this creates a new flavor.

Ram int

The amount of RAM to use, in megabytes. Changing this creates a new flavor.

Vcpus int

The number of virtual CPUs to use. Changing this creates a new flavor.

Description string

The description of the flavor. Changing this updates the description of the flavor. Requires microversion >= 2.55.

Ephemeral int

The amount of ephemeral in GiB. If unspecified, the default is 0. Changing this creates a new flavor.

ExtraSpecs Dictionary<string, object>

Key/Value pairs of metadata for the flavor.

FlavorId string

Unique ID (integer or UUID) of flavor to create. Changing this creates a new flavor.

IsPublic bool

Whether the flavor is public. Changing this creates a new flavor.

Name string

A unique name for the flavor. Changing this creates a new flavor.

Region string

The region in which to obtain the V2 Compute client. Flavors are associated with accounts, but a Compute client is needed to create one. If omitted, the region argument of the provider is used. Changing this creates a new flavor.

RxTxFactor double

RX/TX bandwith factor. The default is 1. Changing this creates a new flavor.

Swap int

The amount of disk space in megabytes to use. If unspecified, the default is 0. Changing this creates a new flavor.

Disk int

The amount of disk space in GiB to use for the root (/) partition. Changing this creates a new flavor.

Ram int

The amount of RAM to use, in megabytes. Changing this creates a new flavor.

Vcpus int

The number of virtual CPUs to use. Changing this creates a new flavor.

Description string

The description of the flavor. Changing this updates the description of the flavor. Requires microversion >= 2.55.

Ephemeral int

The amount of ephemeral in GiB. If unspecified, the default is 0. Changing this creates a new flavor.

ExtraSpecs map[string]interface{}

Key/Value pairs of metadata for the flavor.

FlavorId string

Unique ID (integer or UUID) of flavor to create. Changing this creates a new flavor.

IsPublic bool

Whether the flavor is public. Changing this creates a new flavor.

Name string

A unique name for the flavor. Changing this creates a new flavor.

Region string

The region in which to obtain the V2 Compute client. Flavors are associated with accounts, but a Compute client is needed to create one. If omitted, the region argument of the provider is used. Changing this creates a new flavor.

RxTxFactor float64

RX/TX bandwith factor. The default is 1. Changing this creates a new flavor.

Swap int

The amount of disk space in megabytes to use. If unspecified, the default is 0. Changing this creates a new flavor.

disk Integer

The amount of disk space in GiB to use for the root (/) partition. Changing this creates a new flavor.

ram Integer

The amount of RAM to use, in megabytes. Changing this creates a new flavor.

vcpus Integer

The number of virtual CPUs to use. Changing this creates a new flavor.

description String

The description of the flavor. Changing this updates the description of the flavor. Requires microversion >= 2.55.

ephemeral Integer

The amount of ephemeral in GiB. If unspecified, the default is 0. Changing this creates a new flavor.

extraSpecs Map<String,Object>

Key/Value pairs of metadata for the flavor.

flavorId String

Unique ID (integer or UUID) of flavor to create. Changing this creates a new flavor.

isPublic Boolean

Whether the flavor is public. Changing this creates a new flavor.

name String

A unique name for the flavor. Changing this creates a new flavor.

region String

The region in which to obtain the V2 Compute client. Flavors are associated with accounts, but a Compute client is needed to create one. If omitted, the region argument of the provider is used. Changing this creates a new flavor.

rxTxFactor Double

RX/TX bandwith factor. The default is 1. Changing this creates a new flavor.

swap Integer

The amount of disk space in megabytes to use. If unspecified, the default is 0. Changing this creates a new flavor.

disk number

The amount of disk space in GiB to use for the root (/) partition. Changing this creates a new flavor.

ram number

The amount of RAM to use, in megabytes. Changing this creates a new flavor.

vcpus number

The number of virtual CPUs to use. Changing this creates a new flavor.

description string

The description of the flavor. Changing this updates the description of the flavor. Requires microversion >= 2.55.

ephemeral number

The amount of ephemeral in GiB. If unspecified, the default is 0. Changing this creates a new flavor.

extraSpecs {[key: string]: any}

Key/Value pairs of metadata for the flavor.

flavorId string

Unique ID (integer or UUID) of flavor to create. Changing this creates a new flavor.

isPublic boolean

Whether the flavor is public. Changing this creates a new flavor.

name string

A unique name for the flavor. Changing this creates a new flavor.

region string

The region in which to obtain the V2 Compute client. Flavors are associated with accounts, but a Compute client is needed to create one. If omitted, the region argument of the provider is used. Changing this creates a new flavor.

rxTxFactor number

RX/TX bandwith factor. The default is 1. Changing this creates a new flavor.

swap number

The amount of disk space in megabytes to use. If unspecified, the default is 0. Changing this creates a new flavor.

disk int

The amount of disk space in GiB to use for the root (/) partition. Changing this creates a new flavor.

ram int

The amount of RAM to use, in megabytes. Changing this creates a new flavor.

vcpus int

The number of virtual CPUs to use. Changing this creates a new flavor.

description str

The description of the flavor. Changing this updates the description of the flavor. Requires microversion >= 2.55.

ephemeral int

The amount of ephemeral in GiB. If unspecified, the default is 0. Changing this creates a new flavor.

extra_specs Mapping[str, Any]

Key/Value pairs of metadata for the flavor.

flavor_id str

Unique ID (integer or UUID) of flavor to create. Changing this creates a new flavor.

is_public bool

Whether the flavor is public. Changing this creates a new flavor.

name str

A unique name for the flavor. Changing this creates a new flavor.

region str

The region in which to obtain the V2 Compute client. Flavors are associated with accounts, but a Compute client is needed to create one. If omitted, the region argument of the provider is used. Changing this creates a new flavor.

rx_tx_factor float

RX/TX bandwith factor. The default is 1. Changing this creates a new flavor.

swap int

The amount of disk space in megabytes to use. If unspecified, the default is 0. Changing this creates a new flavor.

disk Number

The amount of disk space in GiB to use for the root (/) partition. Changing this creates a new flavor.

ram Number

The amount of RAM to use, in megabytes. Changing this creates a new flavor.

vcpus Number

The number of virtual CPUs to use. Changing this creates a new flavor.

description String

The description of the flavor. Changing this updates the description of the flavor. Requires microversion >= 2.55.

ephemeral Number

The amount of ephemeral in GiB. If unspecified, the default is 0. Changing this creates a new flavor.

extraSpecs Map<Any>

Key/Value pairs of metadata for the flavor.

flavorId String

Unique ID (integer or UUID) of flavor to create. Changing this creates a new flavor.

isPublic Boolean

Whether the flavor is public. Changing this creates a new flavor.

name String

A unique name for the flavor. Changing this creates a new flavor.

region String

The region in which to obtain the V2 Compute client. Flavors are associated with accounts, but a Compute client is needed to create one. If omitted, the region argument of the provider is used. Changing this creates a new flavor.

rxTxFactor Number

RX/TX bandwith factor. The default is 1. Changing this creates a new flavor.

swap Number

The amount of disk space in megabytes to use. If unspecified, the default is 0. Changing this creates a new flavor.

Outputs

All input properties are implicitly available as output properties. Additionally, the Flavor resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up Existing Flavor Resource

Get an existing Flavor resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: FlavorState, opts?: CustomResourceOptions): Flavor
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        disk: Optional[int] = None,
        ephemeral: Optional[int] = None,
        extra_specs: Optional[Mapping[str, Any]] = None,
        flavor_id: Optional[str] = None,
        is_public: Optional[bool] = None,
        name: Optional[str] = None,
        ram: Optional[int] = None,
        region: Optional[str] = None,
        rx_tx_factor: Optional[float] = None,
        swap: Optional[int] = None,
        vcpus: Optional[int] = None) -> Flavor
func GetFlavor(ctx *Context, name string, id IDInput, state *FlavorState, opts ...ResourceOption) (*Flavor, error)
public static Flavor Get(string name, Input<string> id, FlavorState? state, CustomResourceOptions? opts = null)
public static Flavor get(String name, Output<String> id, FlavorState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Description string

The description of the flavor. Changing this updates the description of the flavor. Requires microversion >= 2.55.

Disk int

The amount of disk space in GiB to use for the root (/) partition. Changing this creates a new flavor.

Ephemeral int

The amount of ephemeral in GiB. If unspecified, the default is 0. Changing this creates a new flavor.

ExtraSpecs Dictionary<string, object>

Key/Value pairs of metadata for the flavor.

FlavorId string

Unique ID (integer or UUID) of flavor to create. Changing this creates a new flavor.

IsPublic bool

Whether the flavor is public. Changing this creates a new flavor.

Name string

A unique name for the flavor. Changing this creates a new flavor.

Ram int

The amount of RAM to use, in megabytes. Changing this creates a new flavor.

Region string

The region in which to obtain the V2 Compute client. Flavors are associated with accounts, but a Compute client is needed to create one. If omitted, the region argument of the provider is used. Changing this creates a new flavor.

RxTxFactor double

RX/TX bandwith factor. The default is 1. Changing this creates a new flavor.

Swap int

The amount of disk space in megabytes to use. If unspecified, the default is 0. Changing this creates a new flavor.

Vcpus int

The number of virtual CPUs to use. Changing this creates a new flavor.

Description string

The description of the flavor. Changing this updates the description of the flavor. Requires microversion >= 2.55.

Disk int

The amount of disk space in GiB to use for the root (/) partition. Changing this creates a new flavor.

Ephemeral int

The amount of ephemeral in GiB. If unspecified, the default is 0. Changing this creates a new flavor.

ExtraSpecs map[string]interface{}

Key/Value pairs of metadata for the flavor.

FlavorId string

Unique ID (integer or UUID) of flavor to create. Changing this creates a new flavor.

IsPublic bool

Whether the flavor is public. Changing this creates a new flavor.

Name string

A unique name for the flavor. Changing this creates a new flavor.

Ram int

The amount of RAM to use, in megabytes. Changing this creates a new flavor.

Region string

The region in which to obtain the V2 Compute client. Flavors are associated with accounts, but a Compute client is needed to create one. If omitted, the region argument of the provider is used. Changing this creates a new flavor.

RxTxFactor float64

RX/TX bandwith factor. The default is 1. Changing this creates a new flavor.

Swap int

The amount of disk space in megabytes to use. If unspecified, the default is 0. Changing this creates a new flavor.

Vcpus int

The number of virtual CPUs to use. Changing this creates a new flavor.

description String

The description of the flavor. Changing this updates the description of the flavor. Requires microversion >= 2.55.

disk Integer

The amount of disk space in GiB to use for the root (/) partition. Changing this creates a new flavor.

ephemeral Integer

The amount of ephemeral in GiB. If unspecified, the default is 0. Changing this creates a new flavor.

extraSpecs Map<String,Object>

Key/Value pairs of metadata for the flavor.

flavorId String

Unique ID (integer or UUID) of flavor to create. Changing this creates a new flavor.

isPublic Boolean

Whether the flavor is public. Changing this creates a new flavor.

name String

A unique name for the flavor. Changing this creates a new flavor.

ram Integer

The amount of RAM to use, in megabytes. Changing this creates a new flavor.

region String

The region in which to obtain the V2 Compute client. Flavors are associated with accounts, but a Compute client is needed to create one. If omitted, the region argument of the provider is used. Changing this creates a new flavor.

rxTxFactor Double

RX/TX bandwith factor. The default is 1. Changing this creates a new flavor.

swap Integer

The amount of disk space in megabytes to use. If unspecified, the default is 0. Changing this creates a new flavor.

vcpus Integer

The number of virtual CPUs to use. Changing this creates a new flavor.

description string

The description of the flavor. Changing this updates the description of the flavor. Requires microversion >= 2.55.

disk number

The amount of disk space in GiB to use for the root (/) partition. Changing this creates a new flavor.

ephemeral number

The amount of ephemeral in GiB. If unspecified, the default is 0. Changing this creates a new flavor.

extraSpecs {[key: string]: any}

Key/Value pairs of metadata for the flavor.

flavorId string

Unique ID (integer or UUID) of flavor to create. Changing this creates a new flavor.

isPublic boolean

Whether the flavor is public. Changing this creates a new flavor.

name string

A unique name for the flavor. Changing this creates a new flavor.

ram number

The amount of RAM to use, in megabytes. Changing this creates a new flavor.

region string

The region in which to obtain the V2 Compute client. Flavors are associated with accounts, but a Compute client is needed to create one. If omitted, the region argument of the provider is used. Changing this creates a new flavor.

rxTxFactor number

RX/TX bandwith factor. The default is 1. Changing this creates a new flavor.

swap number

The amount of disk space in megabytes to use. If unspecified, the default is 0. Changing this creates a new flavor.

vcpus number

The number of virtual CPUs to use. Changing this creates a new flavor.

description str

The description of the flavor. Changing this updates the description of the flavor. Requires microversion >= 2.55.

disk int

The amount of disk space in GiB to use for the root (/) partition. Changing this creates a new flavor.

ephemeral int

The amount of ephemeral in GiB. If unspecified, the default is 0. Changing this creates a new flavor.

extra_specs Mapping[str, Any]

Key/Value pairs of metadata for the flavor.

flavor_id str

Unique ID (integer or UUID) of flavor to create. Changing this creates a new flavor.

is_public bool

Whether the flavor is public. Changing this creates a new flavor.

name str

A unique name for the flavor. Changing this creates a new flavor.

ram int

The amount of RAM to use, in megabytes. Changing this creates a new flavor.

region str

The region in which to obtain the V2 Compute client. Flavors are associated with accounts, but a Compute client is needed to create one. If omitted, the region argument of the provider is used. Changing this creates a new flavor.

rx_tx_factor float

RX/TX bandwith factor. The default is 1. Changing this creates a new flavor.

swap int

The amount of disk space in megabytes to use. If unspecified, the default is 0. Changing this creates a new flavor.

vcpus int

The number of virtual CPUs to use. Changing this creates a new flavor.

description String

The description of the flavor. Changing this updates the description of the flavor. Requires microversion >= 2.55.

disk Number

The amount of disk space in GiB to use for the root (/) partition. Changing this creates a new flavor.

ephemeral Number

The amount of ephemeral in GiB. If unspecified, the default is 0. Changing this creates a new flavor.

extraSpecs Map<Any>

Key/Value pairs of metadata for the flavor.

flavorId String

Unique ID (integer or UUID) of flavor to create. Changing this creates a new flavor.

isPublic Boolean

Whether the flavor is public. Changing this creates a new flavor.

name String

A unique name for the flavor. Changing this creates a new flavor.

ram Number

The amount of RAM to use, in megabytes. Changing this creates a new flavor.

region String

The region in which to obtain the V2 Compute client. Flavors are associated with accounts, but a Compute client is needed to create one. If omitted, the region argument of the provider is used. Changing this creates a new flavor.

rxTxFactor Number

RX/TX bandwith factor. The default is 1. Changing this creates a new flavor.

swap Number

The amount of disk space in megabytes to use. If unspecified, the default is 0. Changing this creates a new flavor.

vcpus Number

The number of virtual CPUs to use. Changing this creates a new flavor.

Import

Flavors can be imported using the ID, e.g.

 $ pulumi import openstack:compute/flavor:Flavor my-flavor 4142e64b-1b35-44a0-9b1e-5affc7af1106

Package Details

Repository
OpenStack pulumi/pulumi-openstack
License
Apache-2.0
Notes

This Pulumi package is based on the openstack Terraform Provider.