Volume class

A volume is a file system container in a storage pool that stores application, database, and user data.

You can create a volume's capacity using the available capacity in the storage pool and you can define and resize the capacity without disruption to any processes.

Storage pool settings apply to the volumes contained within them automatically.

To get more information about Volume, see:

Example Usage

Netapp Volume Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const _default = gcp.compute.getNetwork({
    name: "test-network",
});
const defaultStoragePool = new gcp.netapp.StoragePool("default", {
    name: "test-pool",
    location: "us-west2",
    serviceLevel: "PREMIUM",
    capacityGib: "2048",
    network: _default.then(_default => _default.id),
});
const testVolume = new gcp.netapp.Volume("test_volume", {
    location: "us-west2",
    name: "test-volume",
    capacityGib: "100",
    shareName: "test-volume",
    storagePool: defaultStoragePool.name,
    protocols: ["NFSV3"],
    deletionPolicy: "DEFAULT",
});
import pulumi
import pulumi_gcp as gcp

default = gcp.compute.get_network(name="test-network")
default_storage_pool = gcp.netapp.StoragePool("default",
    name="test-pool",
    location="us-west2",
    service_level="PREMIUM",
    capacity_gib="2048",
    network=default.id)
test_volume = gcp.netapp.Volume("test_volume",
    location="us-west2",
    name="test-volume",
    capacity_gib="100",
    share_name="test-volume",
    storage_pool=default_storage_pool.name,
    protocols=["NFSV3"],
    deletion_policy="DEFAULT")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() =>
{
    var @default = Gcp.Compute.GetNetwork.Invoke(new()
    {
        Name = "test-network",
    });

    var defaultStoragePool = new Gcp.Netapp.StoragePool("default", new()
    {
        Name = "test-pool",
        Location = "us-west2",
        ServiceLevel = "PREMIUM",
        CapacityGib = "2048",
        Network = @default.Apply(@default => @default.Apply(getNetworkResult => getNetworkResult.Id)),
    });

    var testVolume = new Gcp.Netapp.Volume("test_volume", new()
    {
        Location = "us-west2",
        Name = "test-volume",
        CapacityGib = "100",
        ShareName = "test-volume",
        StoragePool = defaultStoragePool.Name,
        Protocols = new[]
        {
            "NFSV3",
        },
        DeletionPolicy = "DEFAULT",
    });

});
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/compute"
	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/netapp"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_default, err := compute.LookupNetwork(ctx, &compute.LookupNetworkArgs{
			Name: pulumi.StringRef("test-network"),
		}, nil)
		if err != nil {
			return err
		}
		defaultStoragePool, err := netapp.NewStoragePool(ctx, "default", &netapp.StoragePoolArgs{
			Name:         pulumi.String("test-pool"),
			Location:     pulumi.String("us-west2"),
			ServiceLevel: pulumi.String("PREMIUM"),
			CapacityGib:  pulumi.String("2048"),
			Network:      pulumi.String(_default.Id),
		})
		if err != nil {
			return err
		}
		_, err = netapp.NewVolume(ctx, "test_volume", &netapp.VolumeArgs{
			Location:    pulumi.String("us-west2"),
			Name:        pulumi.String("test-volume"),
			CapacityGib: pulumi.String("100"),
			ShareName:   pulumi.String("test-volume"),
			StoragePool: defaultStoragePool.Name,
			Protocols: pulumi.StringArray{
				pulumi.String("NFSV3"),
			},
			DeletionPolicy: pulumi.String("DEFAULT"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    gcp = {
      source = "pulumi/gcp"
    }
  }
}

data "gcp_compute_getnetwork" "default" {
  name = "test-network"
}

resource "gcp_netapp_storagepool" "default" {
  name          = "test-pool"
  location      = "us-west2"
  service_level = "PREMIUM"
  capacity_gib  = "2048"
  network       = data.gcp_compute_getnetwork.default.id
}
resource "gcp_netapp_volume" "test_volume" {
  location        = "us-west2"
  name            = "test-volume"
  capacity_gib    = "100"
  share_name      = "test-volume"
  storage_pool    = gcp_netapp_storagepool.default.name
  protocols       = ["NFSV3"]
  deletion_policy = "DEFAULT"
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.ComputeFunctions;
import com.pulumi.gcp.compute.inputs.GetNetworkArgs;
import com.pulumi.gcp.netapp.StoragePool;
import com.pulumi.gcp.netapp.StoragePoolArgs;
import com.pulumi.gcp.netapp.Volume;
import com.pulumi.gcp.netapp.VolumeArgs;
import java.util.ArrayList;
import java.util.Arrays;
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) {
        final var default = ComputeFunctions.getNetwork(GetNetworkArgs.builder()
            .name("test-network")
            .build());

        var defaultStoragePool = new StoragePool("defaultStoragePool", StoragePoolArgs.builder()
            .name("test-pool")
            .location("us-west2")
            .serviceLevel("PREMIUM")
            .capacityGib("2048")
            .network(default_.id())
            .build());

        var testVolume = new Volume("testVolume", VolumeArgs.builder()
            .location("us-west2")
            .name("test-volume")
            .capacityGib("100")
            .shareName("test-volume")
            .storagePool(defaultStoragePool.name())
            .protocols("NFSV3")
            .deletionPolicy("DEFAULT")
            .build());

    }
}
resources:
  defaultStoragePool:
    type: gcp:netapp:StoragePool
    name: default
    properties:
      name: test-pool
      location: us-west2
      serviceLevel: PREMIUM
      capacityGib: '2048'
      network: ${default.id}
  testVolume:
    type: gcp:netapp:Volume
    name: test_volume
    properties:
      location: us-west2
      name: test-volume
      capacityGib: '100'
      shareName: test-volume
      storagePool: ${defaultStoragePool.name}
      protocols:
        - NFSV3
      deletionPolicy: DEFAULT
variables:
  default:
    fn::invoke:
      function: gcp:compute:getNetwork
      arguments:
        name: test-network

Import

Volume can be imported using any of these accepted formats:

  • projects/{{project}}/locations/{{location}}/volumes/{{name}}
  • {{project}}/{{location}}/{{name}}
  • {{location}}/{{name}}

When using the pulumi import command, Volume can be imported using one of the formats above. For example:

$ pulumi import gcp:netapp/volume:Volume default projects/{{project}}/locations/{{location}}/volumes/{{name}}
$ pulumi import gcp:netapp/volume:Volume default {{project}}/{{location}}/{{name}}
$ pulumi import gcp:netapp/volume:Volume default {{location}}/{{name}}

Constructors

Volume(String name, {VolumeArgs? args, CustomResourceOptions? options})
Creates a new Volume. name The Pulumi resource name. args Arguments used to configure this Volume. The set of arguments for Volume. options Resource options controlling this resource's behavior.
Volume.reference(String urn)
Creates a typed reference to an existing Volume resource.

Properties

activeDirectory ↔ Output<String>
Reports the resource name of the Active Directory policy being used. Inherited from storage pool.
latefinal
backupConfig ↔ Output<VolumeBackupConfig?>
Backup configuration for the volume. Structure is documented below.
latefinal
blockDevices ↔ Output<List<VolumeBlockDevice>?>
Block device represents the device(s) which are stored in the block volume. Currently, only one block device is permitted per Volume. Structure is documented below.
latefinal
cacheParameters ↔ Output<VolumeCacheParameters?>
Cache parameters for the volume. Structure is documented below.
latefinal
capacityGib ↔ Output<String>
Capacity of the volume (in GiB).
latefinal
childResources → Set<Resource>
finalinherited
coldTierSizeGib ↔ Output<String>
Output only. Size of the volume cold tier data in GiB.
latefinal
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
createTime ↔ Output<String>
Create time of the volume. A timestamp in RFC3339 UTC "Zulu" format. Examples: "2023-06-22T09:13:01.617Z".
latefinal
deletionPolicy ↔ Output<String>
Policy to determine if the volume should be deleted forcefully. Volumes may have nested snapshot resources. Deleting such a volume will fail. Setting this parameter to FORCE will delete volumes including nested snapshots.
latefinal
description ↔ Output<String?>
An optional description of this resource.
latefinal
effectiveLabels ↔ Output<Map<String, String>>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
latefinal
encryptionType ↔ Output<String>
Reports the data-at-rest encryption type of the volume. Inherited from storage pool.
latefinal
exportPolicy ↔ Output<VolumeExportPolicy?>
Export policy of the volume for NFSV3 and/or NFSV4.1 access. Structure is documented below.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
hasReplication ↔ Output<bool>
Indicates whether the volume is part of a volume replication relationship.
latefinal
hotTierSizeUsedGib ↔ Output<String>
Total hot tier data rounded down to the nearest GiB used by the volume. This field is only used for flex Service Level
latefinal
hybridReplicationParameters ↔ Output<VolumeHybridReplicationParameters?>
Volume migration and external replication are two types of Hybrid Replication. This parameter block specifies the parameters for a hybrid replication. Structure is documented below.
latefinal
id ↔ Output<String>
getter/setter pairinherited
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
kerberosEnabled ↔ Output<bool?>
Flag indicating if the volume is a kerberos volume or not, export policy rules control kerberos security modes (krb5, krb5i, krb5p).
latefinal
kmsConfig ↔ Output<String>
Reports the CMEK policy resurce name being used for volume encryption. Inherited from storage pool.
latefinal
labels ↔ Output<Map<String, String>?>
Labels as key value pairs. Example: { "owner": "Bob", "department": "finance", "purpose": "testing" }.
latefinal
largeCapacity ↔ Output<bool?>
Optional. Flag indicating if the volume will be a large capacity volume or a regular volume.
latefinal
largeCapacityConfig ↔ Output<VolumeLargeCapacityConfig?>
Configuration for a Large Capacity Volume. A Large Capacity Volume supports sizes ranging from 12 TiB to 20 PiB, it is composed of multiple internal constituents, and must be created in a large capacity pool. Structure is documented below.
latefinal
ldapEnabled ↔ Output<bool>
Flag indicating if the volume is NFS LDAP enabled or not. Inherited from storage pool.
latefinal
location ↔ Output<String>
Name of the pool location. Usually a region name, expect for some STANDARD service level pools which require a zone name.
latefinal
mountOptions ↔ Output<List<VolumeMountOption>>
Reports mount instructions for this volume. Structure is documented below.
latefinal
multipleEndpoints ↔ Output<bool?>
Optional. Flag indicating if the volume will have an IP address per node for volumes supporting multiple IP endpoints. Only the volume with largeCapacity will be allowed to have multiple endpoints.
latefinal
name ↔ Output<String>
The name of the volume. Needs to be unique per location.
latefinal
network ↔ Output<String>
VPC network name with format: projects/{{project}}/global/networks/{{network}}. Inherited from storage pool.
latefinal
project ↔ Output<String>
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
latefinal
protocols ↔ Output<List<String>>
The protocol of the volume. Allowed combinations are ['NFSV3'], ['NFSV4'], ['SMB'], ['NFSV3', 'NFSV4'], ['SMB', 'NFSV3'] and ['SMB', 'NFSV4']. Each value may be one of: NFSV3, NFSV4, SMB, ISCSI.
latefinal
psaRange ↔ Output<String>
Name of the Private Service Access allocated range. Inherited from storage pool.
latefinal
pulumiLabels ↔ Output<Map<String, String>>
The combination of labels configured directly on the resource and default labels configured on the provider.
latefinal
replicaZone ↔ Output<String>
Specifies the replica zone for regional volume.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
restoreParameters ↔ Output<VolumeRestoreParameters?>
Used to create this volume from a snapshot (= cloning) or an backup. Structure is documented below.
latefinal
restrictedActions ↔ Output<List<String>?>
List of actions that are restricted on this volume. Each value may be one of: DELETE.
latefinal
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
securityStyle ↔ Output<String>
Security Style of the Volume. Use UNIX to use UNIX or NFSV4 ACLs for file permissions. Use NTFS to use NTFS ACLs for file permissions. Can only be set for volumes which use SMB together with NFS as protocol. Possible values are: NTFS, UNIX.
latefinal
serviceLevel ↔ Output<String>
Service level of the volume. Inherited from storage pool. Supported values are : PREMIUM, EXTREME, STANDARD, FLEX.
latefinal
shareName ↔ Output<String?>
Share name (SMB) or export path (NFS) of the volume. Needs to be unique per location.
latefinal
smbSettings ↔ Output<List<String>>
Settings for volumes with SMB access. Each value may be one of: ENCRYPT_DATA, BROWSABLE, CHANGE_NOTIFY, NON_BROWSABLE, OPLOCKS, SHOW_SNAPSHOT, SHOW_PREVIOUS_VERSIONS, ACCESS_BASED_ENUMERATION, CONTINUOUSLY_AVAILABLE.
latefinal
snapshotDirectory ↔ Output<bool?>
If enabled, a NFS volume will contain a read-only .snapshot directory which provides access to each of the volume's snapshots. Will enable "Previous Versions" support for SMB.
latefinal
snapshotPolicy ↔ Output<VolumeSnapshotPolicy?>
Snapshot policy defines the schedule for automatic snapshot creation. To disable automatic snapshot creation you have to remove the whole snapshotPolicy block. Structure is documented below.
latefinal
state ↔ Output<String>
State of the volume.
latefinal
stateDetails ↔ Output<String>
State details of the volume.
latefinal
storagePool ↔ Output<String>
Name of the storage pool to create the volume in. Pool needs enough spare capacity to accommodate the volume.
latefinal
throughputMibps ↔ Output<double>
Optional. Custom Performance Total Throughput of the pool (in MiB/s).
latefinal
tieringPolicy ↔ Output<VolumeTieringPolicy?>
Tiering policy for the volume. Structure is documented below.
latefinal
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
unixPermissions ↔ Output<String>
Unix permission the mount point will be created with. Default is 0770. Applicable for UNIX security style volumes only.
latefinal
urn ↔ Output<String>
latefinalinherited
usedGib ↔ Output<String>
Used capacity of the volume (in GiB). This is computed periodically and it does not represent the realtime usage.
latefinal
zone ↔ Output<String>
Specifies the active zone for regional volume.
latefinal

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {VolumeState? state, CustomResourceOptions? options}) → Volume
Gets an existing Volume resource's state with the given name and id.