Volume

Manages a V3 volume resource within OpenStack.

Example Usage

using Pulumi;
using OpenStack = Pulumi.OpenStack;

class MyStack : Stack
{
    public MyStack()
    {
        var volume1 = new OpenStack.BlockStorage.Volume("volume1", new OpenStack.BlockStorage.VolumeArgs
        {
            Description = "first test volume",
            Region = "RegionOne",
            Size = 3,
        });
    }

}

Coming soon!

import pulumi
import pulumi_openstack as openstack

volume1 = openstack.blockstorage.Volume("volume1",
    description="first test volume",
    region="RegionOne",
    size=3)
import * as pulumi from "@pulumi/pulumi";
import * as openstack from "@pulumi/openstack";

const volume1 = new openstack.blockstorage.Volume("volume_1", {
    description: "first test volume",
    region: "RegionOne",
    size: 3,
});

Create a Volume Resource

new Volume(name: string, args: VolumeArgs, opts?: CustomResourceOptions);
def Volume(resource_name, opts=None, availability_zone=None, consistency_group_id=None, description=None, enable_online_resize=None, image_id=None, metadata=None, multiattach=None, name=None, region=None, scheduler_hints=None, size=None, snapshot_id=None, source_replica=None, source_vol_id=None, volume_type=None, __props__=None);
func NewVolume(ctx *Context, name string, args VolumeArgs, opts ...ResourceOption) (*Volume, error)
public Volume(string name, VolumeArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args VolumeArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args VolumeArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args VolumeArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Volume Resource Properties

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

Inputs

The Volume resource accepts the following input properties:

Size int

The size of the volume to create (in gigabytes).

AvailabilityZone string

The availability zone for the volume. Changing this creates a new volume.

ConsistencyGroupId string

The consistency group to place the volume in.

Description string

A description of the volume. Changing this updates the volume’s description.

EnableOnlineResize bool

When this option is set it allows extending attached volumes. Note: updating size of an attached volume requires Cinder support for version 3.42 and a compatible storage driver.

ImageId string

The image ID from which to create the volume. Changing this creates a new volume.

Metadata Dictionary<string, object>

Metadata key/value pairs to associate with the volume. Changing this updates the existing volume metadata.

Multiattach bool

Allow the volume to be attached to more than one Compute instance.

Name string

A unique name for the volume. Changing this updates the volume’s name.

Region string

The region in which to create the volume. If omitted, the region argument of the provider is used. Changing this creates a new volume.

SchedulerHints List<Pulumi.OpenStack.BlockStorage.Inputs.VolumeSchedulerHintArgs>

Provide the Cinder scheduler with hints on where to instantiate a volume in the OpenStack cloud. The available hints are described below.

SnapshotId string

The snapshot ID from which to create the volume. Changing this creates a new volume.

SourceReplica string

The volume ID to replicate with.

SourceVolId string

The volume ID from which to create the volume. Changing this creates a new volume.

VolumeType string

The type of volume to create. Changing this creates a new volume.

Size int

The size of the volume to create (in gigabytes).

AvailabilityZone string

The availability zone for the volume. Changing this creates a new volume.

ConsistencyGroupId string

The consistency group to place the volume in.

Description string

A description of the volume. Changing this updates the volume’s description.

EnableOnlineResize bool

When this option is set it allows extending attached volumes. Note: updating size of an attached volume requires Cinder support for version 3.42 and a compatible storage driver.

ImageId string

The image ID from which to create the volume. Changing this creates a new volume.

Metadata map[string]interface{}

Metadata key/value pairs to associate with the volume. Changing this updates the existing volume metadata.

Multiattach bool

Allow the volume to be attached to more than one Compute instance.

Name string

A unique name for the volume. Changing this updates the volume’s name.

Region string

The region in which to create the volume. If omitted, the region argument of the provider is used. Changing this creates a new volume.

SchedulerHints []VolumeSchedulerHint

Provide the Cinder scheduler with hints on where to instantiate a volume in the OpenStack cloud. The available hints are described below.

SnapshotId string

The snapshot ID from which to create the volume. Changing this creates a new volume.

SourceReplica string

The volume ID to replicate with.

SourceVolId string

The volume ID from which to create the volume. Changing this creates a new volume.

VolumeType string

The type of volume to create. Changing this creates a new volume.

size number

The size of the volume to create (in gigabytes).

availabilityZone string

The availability zone for the volume. Changing this creates a new volume.

consistencyGroupId string

The consistency group to place the volume in.

description string

A description of the volume. Changing this updates the volume’s description.

enableOnlineResize boolean

When this option is set it allows extending attached volumes. Note: updating size of an attached volume requires Cinder support for version 3.42 and a compatible storage driver.

imageId string

The image ID from which to create the volume. Changing this creates a new volume.

metadata {[key: string]: any}

Metadata key/value pairs to associate with the volume. Changing this updates the existing volume metadata.

multiattach boolean

Allow the volume to be attached to more than one Compute instance.

name string

A unique name for the volume. Changing this updates the volume’s name.

region string

The region in which to create the volume. If omitted, the region argument of the provider is used. Changing this creates a new volume.

schedulerHints VolumeSchedulerHint[]

Provide the Cinder scheduler with hints on where to instantiate a volume in the OpenStack cloud. The available hints are described below.

snapshotId string

The snapshot ID from which to create the volume. Changing this creates a new volume.

sourceReplica string

The volume ID to replicate with.

sourceVolId string

The volume ID from which to create the volume. Changing this creates a new volume.

volumeType string

The type of volume to create. Changing this creates a new volume.

size float

The size of the volume to create (in gigabytes).

availability_zone str

The availability zone for the volume. Changing this creates a new volume.

consistency_group_id str

The consistency group to place the volume in.

description str

A description of the volume. Changing this updates the volume’s description.

enable_online_resize bool

When this option is set it allows extending attached volumes. Note: updating size of an attached volume requires Cinder support for version 3.42 and a compatible storage driver.

image_id str

The image ID from which to create the volume. Changing this creates a new volume.

metadata Dict[str, Any]

Metadata key/value pairs to associate with the volume. Changing this updates the existing volume metadata.

multiattach bool

Allow the volume to be attached to more than one Compute instance.

name str

A unique name for the volume. Changing this updates the volume’s name.

region str

The region in which to create the volume. If omitted, the region argument of the provider is used. Changing this creates a new volume.

scheduler_hints List[VolumeSchedulerHint]

Provide the Cinder scheduler with hints on where to instantiate a volume in the OpenStack cloud. The available hints are described below.

snapshot_id str

The snapshot ID from which to create the volume. Changing this creates a new volume.

source_replica str

The volume ID to replicate with.

source_vol_id str

The volume ID from which to create the volume. Changing this creates a new volume.

volume_type str

The type of volume to create. Changing this creates a new volume.

Outputs

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

Attachments List<Pulumi.OpenStack.BlockStorage.Outputs.VolumeAttachment>

If a volume is attached to an instance, this attribute will display the Attachment ID, Instance ID, and the Device as the Instance sees it.

Id string
The provider-assigned unique ID for this managed resource.
Attachments []VolumeAttachment

If a volume is attached to an instance, this attribute will display the Attachment ID, Instance ID, and the Device as the Instance sees it.

Id string
The provider-assigned unique ID for this managed resource.
attachments VolumeAttachment[]

If a volume is attached to an instance, this attribute will display the Attachment ID, Instance ID, and the Device as the Instance sees it.

id string
The provider-assigned unique ID for this managed resource.
attachments List[VolumeAttachment]

If a volume is attached to an instance, this attribute will display the Attachment ID, Instance ID, and the Device as the Instance sees it.

id str
The provider-assigned unique ID for this managed resource.

Look up an Existing Volume Resource

Get an existing Volume 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?: VolumeState, opts?: CustomResourceOptions): Volume
static get(resource_name, id, opts=None, attachments=None, availability_zone=None, consistency_group_id=None, description=None, enable_online_resize=None, image_id=None, metadata=None, multiattach=None, name=None, region=None, scheduler_hints=None, size=None, snapshot_id=None, source_replica=None, source_vol_id=None, volume_type=None, __props__=None);
func GetVolume(ctx *Context, name string, id IDInput, state *VolumeState, opts ...ResourceOption) (*Volume, error)
public static Volume Get(string name, Input<string> id, VolumeState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

Attachments List<Pulumi.OpenStack.BlockStorage.Inputs.VolumeAttachmentArgs>

If a volume is attached to an instance, this attribute will display the Attachment ID, Instance ID, and the Device as the Instance sees it.

AvailabilityZone string

The availability zone for the volume. Changing this creates a new volume.

ConsistencyGroupId string

The consistency group to place the volume in.

Description string

A description of the volume. Changing this updates the volume’s description.

EnableOnlineResize bool

When this option is set it allows extending attached volumes. Note: updating size of an attached volume requires Cinder support for version 3.42 and a compatible storage driver.

ImageId string

The image ID from which to create the volume. Changing this creates a new volume.

Metadata Dictionary<string, object>

Metadata key/value pairs to associate with the volume. Changing this updates the existing volume metadata.

Multiattach bool

Allow the volume to be attached to more than one Compute instance.

Name string

A unique name for the volume. Changing this updates the volume’s name.

Region string

The region in which to create the volume. If omitted, the region argument of the provider is used. Changing this creates a new volume.

SchedulerHints List<Pulumi.OpenStack.BlockStorage.Inputs.VolumeSchedulerHintArgs>

Provide the Cinder scheduler with hints on where to instantiate a volume in the OpenStack cloud. The available hints are described below.

Size int

The size of the volume to create (in gigabytes).

SnapshotId string

The snapshot ID from which to create the volume. Changing this creates a new volume.

SourceReplica string

The volume ID to replicate with.

SourceVolId string

The volume ID from which to create the volume. Changing this creates a new volume.

VolumeType string

The type of volume to create. Changing this creates a new volume.

Attachments []VolumeAttachment

If a volume is attached to an instance, this attribute will display the Attachment ID, Instance ID, and the Device as the Instance sees it.

AvailabilityZone string

The availability zone for the volume. Changing this creates a new volume.

ConsistencyGroupId string

The consistency group to place the volume in.

Description string

A description of the volume. Changing this updates the volume’s description.

EnableOnlineResize bool

When this option is set it allows extending attached volumes. Note: updating size of an attached volume requires Cinder support for version 3.42 and a compatible storage driver.

ImageId string

The image ID from which to create the volume. Changing this creates a new volume.

Metadata map[string]interface{}

Metadata key/value pairs to associate with the volume. Changing this updates the existing volume metadata.

Multiattach bool

Allow the volume to be attached to more than one Compute instance.

Name string

A unique name for the volume. Changing this updates the volume’s name.

Region string

The region in which to create the volume. If omitted, the region argument of the provider is used. Changing this creates a new volume.

SchedulerHints []VolumeSchedulerHint

Provide the Cinder scheduler with hints on where to instantiate a volume in the OpenStack cloud. The available hints are described below.

Size int

The size of the volume to create (in gigabytes).

SnapshotId string

The snapshot ID from which to create the volume. Changing this creates a new volume.

SourceReplica string

The volume ID to replicate with.

SourceVolId string

The volume ID from which to create the volume. Changing this creates a new volume.

VolumeType string

The type of volume to create. Changing this creates a new volume.

attachments VolumeAttachment[]

If a volume is attached to an instance, this attribute will display the Attachment ID, Instance ID, and the Device as the Instance sees it.

availabilityZone string

The availability zone for the volume. Changing this creates a new volume.

consistencyGroupId string

The consistency group to place the volume in.

description string

A description of the volume. Changing this updates the volume’s description.

enableOnlineResize boolean

When this option is set it allows extending attached volumes. Note: updating size of an attached volume requires Cinder support for version 3.42 and a compatible storage driver.

imageId string

The image ID from which to create the volume. Changing this creates a new volume.

metadata {[key: string]: any}

Metadata key/value pairs to associate with the volume. Changing this updates the existing volume metadata.

multiattach boolean

Allow the volume to be attached to more than one Compute instance.

name string

A unique name for the volume. Changing this updates the volume’s name.

region string

The region in which to create the volume. If omitted, the region argument of the provider is used. Changing this creates a new volume.

schedulerHints VolumeSchedulerHint[]

Provide the Cinder scheduler with hints on where to instantiate a volume in the OpenStack cloud. The available hints are described below.

size number

The size of the volume to create (in gigabytes).

snapshotId string

The snapshot ID from which to create the volume. Changing this creates a new volume.

sourceReplica string

The volume ID to replicate with.

sourceVolId string

The volume ID from which to create the volume. Changing this creates a new volume.

volumeType string

The type of volume to create. Changing this creates a new volume.

attachments List[VolumeAttachment]

If a volume is attached to an instance, this attribute will display the Attachment ID, Instance ID, and the Device as the Instance sees it.

availability_zone str

The availability zone for the volume. Changing this creates a new volume.

consistency_group_id str

The consistency group to place the volume in.

description str

A description of the volume. Changing this updates the volume’s description.

enable_online_resize bool

When this option is set it allows extending attached volumes. Note: updating size of an attached volume requires Cinder support for version 3.42 and a compatible storage driver.

image_id str

The image ID from which to create the volume. Changing this creates a new volume.

metadata Dict[str, Any]

Metadata key/value pairs to associate with the volume. Changing this updates the existing volume metadata.

multiattach bool

Allow the volume to be attached to more than one Compute instance.

name str

A unique name for the volume. Changing this updates the volume’s name.

region str

The region in which to create the volume. If omitted, the region argument of the provider is used. Changing this creates a new volume.

scheduler_hints List[VolumeSchedulerHint]

Provide the Cinder scheduler with hints on where to instantiate a volume in the OpenStack cloud. The available hints are described below.

size float

The size of the volume to create (in gigabytes).

snapshot_id str

The snapshot ID from which to create the volume. Changing this creates a new volume.

source_replica str

The volume ID to replicate with.

source_vol_id str

The volume ID from which to create the volume. Changing this creates a new volume.

volume_type str

The type of volume to create. Changing this creates a new volume.

Supporting Types

VolumeAttachment

See the output API doc for this type.

See the output API doc for this type.

See the output API doc for this type.

Device string
Id string
InstanceId string
Device string
Id string
InstanceId string
device string
id string
instanceId string
device str
id str
instance_id str

VolumeSchedulerHint

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

AdditionalProperties Dictionary<string, object>

Arbitrary key/value pairs of additional properties to pass to the scheduler.

DifferentHosts List<string>

The volume should be scheduled on a different host from the set of volumes specified in the list provided.

LocalToInstance string

An instance UUID. The volume should be scheduled on the same host as the instance.

Query string

A conditional query that a back-end must pass in order to host a volume. The query must use the JsonFilter syntax which is described here. At this time, only simple queries are supported. Compound queries using and, or, or not are not supported. An example of a simple query is:

SameHosts List<string>

A list of volume UUIDs. The volume should be scheduled on the same host as another volume specified in the list provided.

AdditionalProperties map[string]interface{}

Arbitrary key/value pairs of additional properties to pass to the scheduler.

DifferentHosts []string

The volume should be scheduled on a different host from the set of volumes specified in the list provided.

LocalToInstance string

An instance UUID. The volume should be scheduled on the same host as the instance.

Query string

A conditional query that a back-end must pass in order to host a volume. The query must use the JsonFilter syntax which is described here. At this time, only simple queries are supported. Compound queries using and, or, or not are not supported. An example of a simple query is:

SameHosts []string

A list of volume UUIDs. The volume should be scheduled on the same host as another volume specified in the list provided.

additionalProperties {[key: string]: any}

Arbitrary key/value pairs of additional properties to pass to the scheduler.

differentHosts string[]

The volume should be scheduled on a different host from the set of volumes specified in the list provided.

localToInstance string

An instance UUID. The volume should be scheduled on the same host as the instance.

query string

A conditional query that a back-end must pass in order to host a volume. The query must use the JsonFilter syntax which is described here. At this time, only simple queries are supported. Compound queries using and, or, or not are not supported. An example of a simple query is:

sameHosts string[]

A list of volume UUIDs. The volume should be scheduled on the same host as another volume specified in the list provided.

additionalProperties Dict[str, Any]

Arbitrary key/value pairs of additional properties to pass to the scheduler.

differentHosts List[str]

The volume should be scheduled on a different host from the set of volumes specified in the list provided.

localToInstance str

An instance UUID. The volume should be scheduled on the same host as the instance.

query str

A conditional query that a back-end must pass in order to host a volume. The query must use the JsonFilter syntax which is described here. At this time, only simple queries are supported. Compound queries using and, or, or not are not supported. An example of a simple query is:

sameHosts List[str]

A list of volume UUIDs. The volume should be scheduled on the same host as another volume specified in the list provided.

Package Details

Repository
https://github.com/pulumi/pulumi-openstack
License
Apache-2.0
Notes
This Pulumi package is based on the openstack Terraform Provider.