1. Packages
  2. Ibm Provider
  3. API Docs
  4. PiVolumeAttach
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

ibm.PiVolumeAttach

Explore with Pulumi AI

ibm logo
ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud

    Attaches and Detaches a volume to a Power Systems Virtual Server instance. For more information, about managing volume, see getting started with IBM Power Systems Virtual Servers.

    Example Usage

    The following example attaches volume to a power systems virtual server instance.

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const testaccVolumeAttach = new ibm.PiVolumeAttach("testaccVolumeAttach", {
        piCloudInstanceId: "<value of the cloud_instance_id>",
        piInstanceId: "<pvm instance id>",
        piVolumeId: "<id of the volume to attach>",
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    testacc_volume_attach = ibm.PiVolumeAttach("testaccVolumeAttach",
        pi_cloud_instance_id="<value of the cloud_instance_id>",
        pi_instance_id="<pvm instance id>",
        pi_volume_id="<id of the volume to attach>")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ibm.NewPiVolumeAttach(ctx, "testaccVolumeAttach", &ibm.PiVolumeAttachArgs{
    			PiCloudInstanceId: pulumi.String("<value of the cloud_instance_id>"),
    			PiInstanceId:      pulumi.String("<pvm instance id>"),
    			PiVolumeId:        pulumi.String("<id of the volume to attach>"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var testaccVolumeAttach = new Ibm.PiVolumeAttach("testaccVolumeAttach", new()
        {
            PiCloudInstanceId = "<value of the cloud_instance_id>",
            PiInstanceId = "<pvm instance id>",
            PiVolumeId = "<id of the volume to attach>",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.PiVolumeAttach;
    import com.pulumi.ibm.PiVolumeAttachArgs;
    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 testaccVolumeAttach = new PiVolumeAttach("testaccVolumeAttach", PiVolumeAttachArgs.builder()
                .piCloudInstanceId("<value of the cloud_instance_id>")
                .piInstanceId("<pvm instance id>")
                .piVolumeId("<id of the volume to attach>")
                .build());
    
        }
    }
    
    resources:
      testaccVolumeAttach:
        type: ibm:PiVolumeAttach
        properties:
          piCloudInstanceId: <value of the cloud_instance_id>
          piInstanceId: <pvm instance id>
          piVolumeId: <id of the volume to attach>
    

    Notes

    • Please find supported Regions for endpoints.
    • If a Power cloud instance is provisioned at lon04, The provider level attributes should be as follows:
      • region - lon
      • zone - lon04

    Example usage:

    import * as pulumi from "@pulumi/pulumi";
    
    import pulumi
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    
    return await Deployment.RunAsync(() => 
    {
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    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) {
        }
    }
    
    {}
    

    Create PiVolumeAttach Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new PiVolumeAttach(name: string, args: PiVolumeAttachArgs, opts?: CustomResourceOptions);
    @overload
    def PiVolumeAttach(resource_name: str,
                       args: PiVolumeAttachArgs,
                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def PiVolumeAttach(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       pi_cloud_instance_id: Optional[str] = None,
                       pi_instance_id: Optional[str] = None,
                       pi_volume_id: Optional[str] = None,
                       pi_volume_attach_id: Optional[str] = None,
                       timeouts: Optional[PiVolumeAttachTimeoutsArgs] = None)
    func NewPiVolumeAttach(ctx *Context, name string, args PiVolumeAttachArgs, opts ...ResourceOption) (*PiVolumeAttach, error)
    public PiVolumeAttach(string name, PiVolumeAttachArgs args, CustomResourceOptions? opts = null)
    public PiVolumeAttach(String name, PiVolumeAttachArgs args)
    public PiVolumeAttach(String name, PiVolumeAttachArgs args, CustomResourceOptions options)
    
    type: ibm:PiVolumeAttach
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args PiVolumeAttachArgs
    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 PiVolumeAttachArgs
    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 PiVolumeAttachArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PiVolumeAttachArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PiVolumeAttachArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var piVolumeAttachResource = new Ibm.PiVolumeAttach("piVolumeAttachResource", new()
    {
        PiCloudInstanceId = "string",
        PiInstanceId = "string",
        PiVolumeId = "string",
        PiVolumeAttachId = "string",
        Timeouts = new Ibm.Inputs.PiVolumeAttachTimeoutsArgs
        {
            Create = "string",
            Delete = "string",
        },
    });
    
    example, err := ibm.NewPiVolumeAttach(ctx, "piVolumeAttachResource", &ibm.PiVolumeAttachArgs{
    	PiCloudInstanceId: pulumi.String("string"),
    	PiInstanceId:      pulumi.String("string"),
    	PiVolumeId:        pulumi.String("string"),
    	PiVolumeAttachId:  pulumi.String("string"),
    	Timeouts: &ibm.PiVolumeAttachTimeoutsArgs{
    		Create: pulumi.String("string"),
    		Delete: pulumi.String("string"),
    	},
    })
    
    var piVolumeAttachResource = new PiVolumeAttach("piVolumeAttachResource", PiVolumeAttachArgs.builder()
        .piCloudInstanceId("string")
        .piInstanceId("string")
        .piVolumeId("string")
        .piVolumeAttachId("string")
        .timeouts(PiVolumeAttachTimeoutsArgs.builder()
            .create("string")
            .delete("string")
            .build())
        .build());
    
    pi_volume_attach_resource = ibm.PiVolumeAttach("piVolumeAttachResource",
        pi_cloud_instance_id="string",
        pi_instance_id="string",
        pi_volume_id="string",
        pi_volume_attach_id="string",
        timeouts={
            "create": "string",
            "delete": "string",
        })
    
    const piVolumeAttachResource = new ibm.PiVolumeAttach("piVolumeAttachResource", {
        piCloudInstanceId: "string",
        piInstanceId: "string",
        piVolumeId: "string",
        piVolumeAttachId: "string",
        timeouts: {
            create: "string",
            "delete": "string",
        },
    });
    
    type: ibm:PiVolumeAttach
    properties:
        piCloudInstanceId: string
        piInstanceId: string
        piVolumeAttachId: string
        piVolumeId: string
        timeouts:
            create: string
            delete: string
    

    PiVolumeAttach Resource Properties

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

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The PiVolumeAttach resource accepts the following input properties:

    PiCloudInstanceId string
    The GUID of the service instance associated with an account.
    PiInstanceId string
    The ID of the pvm instance to attach the volume to.
    PiVolumeId string
    The ID of the volume to attach.
    PiVolumeAttachId string
    (String) The unique identifier of the volume attach. The ID is composed of <pi_cloud_instance_id>/<instance_id>/<volume_id>.
    Timeouts PiVolumeAttachTimeouts
    PiCloudInstanceId string
    The GUID of the service instance associated with an account.
    PiInstanceId string
    The ID of the pvm instance to attach the volume to.
    PiVolumeId string
    The ID of the volume to attach.
    PiVolumeAttachId string
    (String) The unique identifier of the volume attach. The ID is composed of <pi_cloud_instance_id>/<instance_id>/<volume_id>.
    Timeouts PiVolumeAttachTimeoutsArgs
    piCloudInstanceId String
    The GUID of the service instance associated with an account.
    piInstanceId String
    The ID of the pvm instance to attach the volume to.
    piVolumeId String
    The ID of the volume to attach.
    piVolumeAttachId String
    (String) The unique identifier of the volume attach. The ID is composed of <pi_cloud_instance_id>/<instance_id>/<volume_id>.
    timeouts PiVolumeAttachTimeouts
    piCloudInstanceId string
    The GUID of the service instance associated with an account.
    piInstanceId string
    The ID of the pvm instance to attach the volume to.
    piVolumeId string
    The ID of the volume to attach.
    piVolumeAttachId string
    (String) The unique identifier of the volume attach. The ID is composed of <pi_cloud_instance_id>/<instance_id>/<volume_id>.
    timeouts PiVolumeAttachTimeouts
    pi_cloud_instance_id str
    The GUID of the service instance associated with an account.
    pi_instance_id str
    The ID of the pvm instance to attach the volume to.
    pi_volume_id str
    The ID of the volume to attach.
    pi_volume_attach_id str
    (String) The unique identifier of the volume attach. The ID is composed of <pi_cloud_instance_id>/<instance_id>/<volume_id>.
    timeouts PiVolumeAttachTimeoutsArgs
    piCloudInstanceId String
    The GUID of the service instance associated with an account.
    piInstanceId String
    The ID of the pvm instance to attach the volume to.
    piVolumeId String
    The ID of the volume to attach.
    piVolumeAttachId String
    (String) The unique identifier of the volume attach. The ID is composed of <pi_cloud_instance_id>/<instance_id>/<volume_id>.
    timeouts Property Map

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    (String) The status of the volume.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    (String) The status of the volume.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    (String) The status of the volume.
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    (String) The status of the volume.
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    (String) The status of the volume.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    (String) The status of the volume.

    Look up Existing PiVolumeAttach Resource

    Get an existing PiVolumeAttach 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?: PiVolumeAttachState, opts?: CustomResourceOptions): PiVolumeAttach
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            pi_cloud_instance_id: Optional[str] = None,
            pi_instance_id: Optional[str] = None,
            pi_volume_attach_id: Optional[str] = None,
            pi_volume_id: Optional[str] = None,
            status: Optional[str] = None,
            timeouts: Optional[PiVolumeAttachTimeoutsArgs] = None) -> PiVolumeAttach
    func GetPiVolumeAttach(ctx *Context, name string, id IDInput, state *PiVolumeAttachState, opts ...ResourceOption) (*PiVolumeAttach, error)
    public static PiVolumeAttach Get(string name, Input<string> id, PiVolumeAttachState? state, CustomResourceOptions? opts = null)
    public static PiVolumeAttach get(String name, Output<String> id, PiVolumeAttachState state, CustomResourceOptions options)
    resources:  _:    type: ibm:PiVolumeAttach    get:      id: ${id}
    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:
    PiCloudInstanceId string
    The GUID of the service instance associated with an account.
    PiInstanceId string
    The ID of the pvm instance to attach the volume to.
    PiVolumeAttachId string
    (String) The unique identifier of the volume attach. The ID is composed of <pi_cloud_instance_id>/<instance_id>/<volume_id>.
    PiVolumeId string
    The ID of the volume to attach.
    Status string
    (String) The status of the volume.
    Timeouts PiVolumeAttachTimeouts
    PiCloudInstanceId string
    The GUID of the service instance associated with an account.
    PiInstanceId string
    The ID of the pvm instance to attach the volume to.
    PiVolumeAttachId string
    (String) The unique identifier of the volume attach. The ID is composed of <pi_cloud_instance_id>/<instance_id>/<volume_id>.
    PiVolumeId string
    The ID of the volume to attach.
    Status string
    (String) The status of the volume.
    Timeouts PiVolumeAttachTimeoutsArgs
    piCloudInstanceId String
    The GUID of the service instance associated with an account.
    piInstanceId String
    The ID of the pvm instance to attach the volume to.
    piVolumeAttachId String
    (String) The unique identifier of the volume attach. The ID is composed of <pi_cloud_instance_id>/<instance_id>/<volume_id>.
    piVolumeId String
    The ID of the volume to attach.
    status String
    (String) The status of the volume.
    timeouts PiVolumeAttachTimeouts
    piCloudInstanceId string
    The GUID of the service instance associated with an account.
    piInstanceId string
    The ID of the pvm instance to attach the volume to.
    piVolumeAttachId string
    (String) The unique identifier of the volume attach. The ID is composed of <pi_cloud_instance_id>/<instance_id>/<volume_id>.
    piVolumeId string
    The ID of the volume to attach.
    status string
    (String) The status of the volume.
    timeouts PiVolumeAttachTimeouts
    pi_cloud_instance_id str
    The GUID of the service instance associated with an account.
    pi_instance_id str
    The ID of the pvm instance to attach the volume to.
    pi_volume_attach_id str
    (String) The unique identifier of the volume attach. The ID is composed of <pi_cloud_instance_id>/<instance_id>/<volume_id>.
    pi_volume_id str
    The ID of the volume to attach.
    status str
    (String) The status of the volume.
    timeouts PiVolumeAttachTimeoutsArgs
    piCloudInstanceId String
    The GUID of the service instance associated with an account.
    piInstanceId String
    The ID of the pvm instance to attach the volume to.
    piVolumeAttachId String
    (String) The unique identifier of the volume attach. The ID is composed of <pi_cloud_instance_id>/<instance_id>/<volume_id>.
    piVolumeId String
    The ID of the volume to attach.
    status String
    (String) The status of the volume.
    timeouts Property Map

    Supporting Types

    PiVolumeAttachTimeouts, PiVolumeAttachTimeoutsArgs

    Create string
    Delete string
    Create string
    Delete string
    create String
    delete String
    create string
    delete string
    create str
    delete str
    create String
    delete String

    Import

    Example

    bash

    $ pulumi import ibm:index/piVolumeAttach:PiVolumeAttach example d7bec597-4726-451f-8a63-e62e6f19c32c/49fba6c9-23f8-40bc-9899-aca322ee7d5b/cea6651a-bc0a-4438-9f8a-a0770bbf3ebb
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    ibm ibm-cloud/terraform-provider-ibm
    License
    Notes
    This Pulumi package is based on the ibm Terraform Provider.
    ibm logo
    ibm 1.78.0 published on Wednesday, Apr 30, 2025 by ibm-cloud