1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Ocvp
  5. getDatastores
Oracle Cloud Infrastructure v3.10.0 published on Wednesday, Nov 5, 2025 by Pulumi

oci.Ocvp.getDatastores

Start a Neo task
Explain and create an oci.Ocvp.getDatastores resource
oci logo
Oracle Cloud Infrastructure v3.10.0 published on Wednesday, Nov 5, 2025 by Pulumi

    This data source provides the list of Datastores in Oracle Cloud Infrastructure Oracle Cloud VMware Solution service.

    List the Datastores in the specified compartment. The list can be filtered by compartment, datastore id, display name and lifecycle state.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testDatastores = oci.Ocvp.getDatastores({
        compartmentId: compartmentId,
        clusterId: testCluster.id,
        datastoreId: testDatastore.id,
        displayName: datastoreDisplayName,
        state: datastoreState,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_datastores = oci.Ocvp.get_datastores(compartment_id=compartment_id,
        cluster_id=test_cluster["id"],
        datastore_id=test_datastore["id"],
        display_name=datastore_display_name,
        state=datastore_state)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/v3/go/oci/ocvp"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ocvp.GetDatastores(ctx, &ocvp.GetDatastoresArgs{
    			CompartmentId: compartmentId,
    			ClusterId:     pulumi.StringRef(testCluster.Id),
    			DatastoreId:   pulumi.StringRef(testDatastore.Id),
    			DisplayName:   pulumi.StringRef(datastoreDisplayName),
    			State:         pulumi.StringRef(datastoreState),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Oci = Pulumi.Oci;
    
    return await Deployment.RunAsync(() => 
    {
        var testDatastores = Oci.Ocvp.GetDatastores.Invoke(new()
        {
            CompartmentId = compartmentId,
            ClusterId = testCluster.Id,
            DatastoreId = testDatastore.Id,
            DisplayName = datastoreDisplayName,
            State = datastoreState,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.Ocvp.OcvpFunctions;
    import com.pulumi.oci.Ocvp.inputs.GetDatastoresArgs;
    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) {
            final var testDatastores = OcvpFunctions.getDatastores(GetDatastoresArgs.builder()
                .compartmentId(compartmentId)
                .clusterId(testCluster.id())
                .datastoreId(testDatastore.id())
                .displayName(datastoreDisplayName)
                .state(datastoreState)
                .build());
    
        }
    }
    
    variables:
      testDatastores:
        fn::invoke:
          function: oci:Ocvp:getDatastores
          arguments:
            compartmentId: ${compartmentId}
            clusterId: ${testCluster.id}
            datastoreId: ${testDatastore.id}
            displayName: ${datastoreDisplayName}
            state: ${datastoreState}
    

    Using getDatastores

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getDatastores(args: GetDatastoresArgs, opts?: InvokeOptions): Promise<GetDatastoresResult>
    function getDatastoresOutput(args: GetDatastoresOutputArgs, opts?: InvokeOptions): Output<GetDatastoresResult>
    def get_datastores(cluster_id: Optional[str] = None,
                       compartment_id: Optional[str] = None,
                       datastore_id: Optional[str] = None,
                       display_name: Optional[str] = None,
                       filters: Optional[Sequence[GetDatastoresFilter]] = None,
                       state: Optional[str] = None,
                       opts: Optional[InvokeOptions] = None) -> GetDatastoresResult
    def get_datastores_output(cluster_id: Optional[pulumi.Input[str]] = None,
                       compartment_id: Optional[pulumi.Input[str]] = None,
                       datastore_id: Optional[pulumi.Input[str]] = None,
                       display_name: Optional[pulumi.Input[str]] = None,
                       filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetDatastoresFilterArgs]]]] = None,
                       state: Optional[pulumi.Input[str]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetDatastoresResult]
    func GetDatastores(ctx *Context, args *GetDatastoresArgs, opts ...InvokeOption) (*GetDatastoresResult, error)
    func GetDatastoresOutput(ctx *Context, args *GetDatastoresOutputArgs, opts ...InvokeOption) GetDatastoresResultOutput

    > Note: This function is named GetDatastores in the Go SDK.

    public static class GetDatastores 
    {
        public static Task<GetDatastoresResult> InvokeAsync(GetDatastoresArgs args, InvokeOptions? opts = null)
        public static Output<GetDatastoresResult> Invoke(GetDatastoresInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetDatastoresResult> getDatastores(GetDatastoresArgs args, InvokeOptions options)
    public static Output<GetDatastoresResult> getDatastores(GetDatastoresArgs args, InvokeOptions options)
    
    fn::invoke:
      function: oci:Ocvp/getDatastores:getDatastores
      arguments:
        # arguments dictionary

    The following arguments are supported:

    CompartmentId string
    The OCID of the compartment.
    ClusterId string
    The OCID of the SDDC Cluster.
    DatastoreId string
    The OCID of the Datastore.
    DisplayName string
    A filter to return only resources that match the given display name exactly.
    Filters List<GetDatastoresFilter>
    State string
    The lifecycle state of the resource.
    CompartmentId string
    The OCID of the compartment.
    ClusterId string
    The OCID of the SDDC Cluster.
    DatastoreId string
    The OCID of the Datastore.
    DisplayName string
    A filter to return only resources that match the given display name exactly.
    Filters []GetDatastoresFilter
    State string
    The lifecycle state of the resource.
    compartmentId String
    The OCID of the compartment.
    clusterId String
    The OCID of the SDDC Cluster.
    datastoreId String
    The OCID of the Datastore.
    displayName String
    A filter to return only resources that match the given display name exactly.
    filters List<GetDatastoresFilter>
    state String
    The lifecycle state of the resource.
    compartmentId string
    The OCID of the compartment.
    clusterId string
    The OCID of the SDDC Cluster.
    datastoreId string
    The OCID of the Datastore.
    displayName string
    A filter to return only resources that match the given display name exactly.
    filters GetDatastoresFilter[]
    state string
    The lifecycle state of the resource.
    compartment_id str
    The OCID of the compartment.
    cluster_id str
    The OCID of the SDDC Cluster.
    datastore_id str
    The OCID of the Datastore.
    display_name str
    A filter to return only resources that match the given display name exactly.
    filters Sequence[GetDatastoresFilter]
    state str
    The lifecycle state of the resource.
    compartmentId String
    The OCID of the compartment.
    clusterId String
    The OCID of the SDDC Cluster.
    datastoreId String
    The OCID of the Datastore.
    displayName String
    A filter to return only resources that match the given display name exactly.
    filters List<Property Map>
    state String
    The lifecycle state of the resource.

    getDatastores Result

    The following output properties are available:

    CompartmentId string
    The OCID of the compartment that contains the Datastore.
    DatastoreCollections List<GetDatastoresDatastoreCollection>
    The list of datastore_collection.
    Id string
    The provider-assigned unique ID for this managed resource.
    ClusterId string
    The OCID of the VMware Cluster that Datastore is attached to.
    DatastoreId string
    DisplayName string
    A descriptive name for the Datastore. It must be unique within a SDDC, start with a letter, and contain only letters, digits, whitespaces, dashes and underscores. Avoid entering confidential information.
    Filters List<GetDatastoresFilter>
    State string
    The current state of the Datastore.
    CompartmentId string
    The OCID of the compartment that contains the Datastore.
    DatastoreCollections []GetDatastoresDatastoreCollection
    The list of datastore_collection.
    Id string
    The provider-assigned unique ID for this managed resource.
    ClusterId string
    The OCID of the VMware Cluster that Datastore is attached to.
    DatastoreId string
    DisplayName string
    A descriptive name for the Datastore. It must be unique within a SDDC, start with a letter, and contain only letters, digits, whitespaces, dashes and underscores. Avoid entering confidential information.
    Filters []GetDatastoresFilter
    State string
    The current state of the Datastore.
    compartmentId String
    The OCID of the compartment that contains the Datastore.
    datastoreCollections List<GetDatastoresDatastoreCollection>
    The list of datastore_collection.
    id String
    The provider-assigned unique ID for this managed resource.
    clusterId String
    The OCID of the VMware Cluster that Datastore is attached to.
    datastoreId String
    displayName String
    A descriptive name for the Datastore. It must be unique within a SDDC, start with a letter, and contain only letters, digits, whitespaces, dashes and underscores. Avoid entering confidential information.
    filters List<GetDatastoresFilter>
    state String
    The current state of the Datastore.
    compartmentId string
    The OCID of the compartment that contains the Datastore.
    datastoreCollections GetDatastoresDatastoreCollection[]
    The list of datastore_collection.
    id string
    The provider-assigned unique ID for this managed resource.
    clusterId string
    The OCID of the VMware Cluster that Datastore is attached to.
    datastoreId string
    displayName string
    A descriptive name for the Datastore. It must be unique within a SDDC, start with a letter, and contain only letters, digits, whitespaces, dashes and underscores. Avoid entering confidential information.
    filters GetDatastoresFilter[]
    state string
    The current state of the Datastore.
    compartment_id str
    The OCID of the compartment that contains the Datastore.
    datastore_collections Sequence[GetDatastoresDatastoreCollection]
    The list of datastore_collection.
    id str
    The provider-assigned unique ID for this managed resource.
    cluster_id str
    The OCID of the VMware Cluster that Datastore is attached to.
    datastore_id str
    display_name str
    A descriptive name for the Datastore. It must be unique within a SDDC, start with a letter, and contain only letters, digits, whitespaces, dashes and underscores. Avoid entering confidential information.
    filters Sequence[GetDatastoresFilter]
    state str
    The current state of the Datastore.
    compartmentId String
    The OCID of the compartment that contains the Datastore.
    datastoreCollections List<Property Map>
    The list of datastore_collection.
    id String
    The provider-assigned unique ID for this managed resource.
    clusterId String
    The OCID of the VMware Cluster that Datastore is attached to.
    datastoreId String
    displayName String
    A descriptive name for the Datastore. It must be unique within a SDDC, start with a letter, and contain only letters, digits, whitespaces, dashes and underscores. Avoid entering confidential information.
    filters List<Property Map>
    state String
    The current state of the Datastore.

    Supporting Types

    GetDatastoresDatastoreCollection

    GetDatastoresDatastoreCollectionItem

    AvailabilityDomain string
    The availability domain of the Datastore.
    BlockVolumeDetails List<GetDatastoresDatastoreCollectionItemBlockVolumeDetail>
    The list of Block Volume details that belong to the datastore.
    BlockVolumeIds List<string>
    The List of Block volume OCIDs that belong to the Datastore.
    CapacityInGbs double
    Total size of the datastore in GB.
    ClusterId string
    The OCID of the SDDC Cluster.
    CompartmentId string
    The OCID of the compartment.
    DefinedTags Dictionary<string, string>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    DisplayName string
    A filter to return only resources that match the given display name exactly.
    FreeformTags Dictionary<string, string>
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    Id string
    The OCID of the Datastore.
    SddcId string
    The OCID of the SDDC that Datastore is associated with.
    State string
    The lifecycle state of the resource.
    SystemTags Dictionary<string, string>
    Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {orcl-cloud: {free-tier-retain: true}}
    TimeCreated string
    The date and time the Datastore was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    TimeUpdated string
    The date and time the Datastore was updated, in the format defined by RFC3339.
    AvailabilityDomain string
    The availability domain of the Datastore.
    BlockVolumeDetails []GetDatastoresDatastoreCollectionItemBlockVolumeDetail
    The list of Block Volume details that belong to the datastore.
    BlockVolumeIds []string
    The List of Block volume OCIDs that belong to the Datastore.
    CapacityInGbs float64
    Total size of the datastore in GB.
    ClusterId string
    The OCID of the SDDC Cluster.
    CompartmentId string
    The OCID of the compartment.
    DefinedTags map[string]string
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    DisplayName string
    A filter to return only resources that match the given display name exactly.
    FreeformTags map[string]string
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    Id string
    The OCID of the Datastore.
    SddcId string
    The OCID of the SDDC that Datastore is associated with.
    State string
    The lifecycle state of the resource.
    SystemTags map[string]string
    Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {orcl-cloud: {free-tier-retain: true}}
    TimeCreated string
    The date and time the Datastore was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    TimeUpdated string
    The date and time the Datastore was updated, in the format defined by RFC3339.
    availabilityDomain String
    The availability domain of the Datastore.
    blockVolumeDetails List<GetDatastoresDatastoreCollectionItemBlockVolumeDetail>
    The list of Block Volume details that belong to the datastore.
    blockVolumeIds List<String>
    The List of Block volume OCIDs that belong to the Datastore.
    capacityInGbs Double
    Total size of the datastore in GB.
    clusterId String
    The OCID of the SDDC Cluster.
    compartmentId String
    The OCID of the compartment.
    definedTags Map<String,String>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    displayName String
    A filter to return only resources that match the given display name exactly.
    freeformTags Map<String,String>
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    id String
    The OCID of the Datastore.
    sddcId String
    The OCID of the SDDC that Datastore is associated with.
    state String
    The lifecycle state of the resource.
    systemTags Map<String,String>
    Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {orcl-cloud: {free-tier-retain: true}}
    timeCreated String
    The date and time the Datastore was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    timeUpdated String
    The date and time the Datastore was updated, in the format defined by RFC3339.
    availabilityDomain string
    The availability domain of the Datastore.
    blockVolumeDetails GetDatastoresDatastoreCollectionItemBlockVolumeDetail[]
    The list of Block Volume details that belong to the datastore.
    blockVolumeIds string[]
    The List of Block volume OCIDs that belong to the Datastore.
    capacityInGbs number
    Total size of the datastore in GB.
    clusterId string
    The OCID of the SDDC Cluster.
    compartmentId string
    The OCID of the compartment.
    definedTags {[key: string]: string}
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    displayName string
    A filter to return only resources that match the given display name exactly.
    freeformTags {[key: string]: string}
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    id string
    The OCID of the Datastore.
    sddcId string
    The OCID of the SDDC that Datastore is associated with.
    state string
    The lifecycle state of the resource.
    systemTags {[key: string]: string}
    Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {orcl-cloud: {free-tier-retain: true}}
    timeCreated string
    The date and time the Datastore was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    timeUpdated string
    The date and time the Datastore was updated, in the format defined by RFC3339.
    availability_domain str
    The availability domain of the Datastore.
    block_volume_details Sequence[GetDatastoresDatastoreCollectionItemBlockVolumeDetail]
    The list of Block Volume details that belong to the datastore.
    block_volume_ids Sequence[str]
    The List of Block volume OCIDs that belong to the Datastore.
    capacity_in_gbs float
    Total size of the datastore in GB.
    cluster_id str
    The OCID of the SDDC Cluster.
    compartment_id str
    The OCID of the compartment.
    defined_tags Mapping[str, str]
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    display_name str
    A filter to return only resources that match the given display name exactly.
    freeform_tags Mapping[str, str]
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    id str
    The OCID of the Datastore.
    sddc_id str
    The OCID of the SDDC that Datastore is associated with.
    state str
    The lifecycle state of the resource.
    system_tags Mapping[str, str]
    Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {orcl-cloud: {free-tier-retain: true}}
    time_created str
    The date and time the Datastore was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    time_updated str
    The date and time the Datastore was updated, in the format defined by RFC3339.
    availabilityDomain String
    The availability domain of the Datastore.
    blockVolumeDetails List<Property Map>
    The list of Block Volume details that belong to the datastore.
    blockVolumeIds List<String>
    The List of Block volume OCIDs that belong to the Datastore.
    capacityInGbs Number
    Total size of the datastore in GB.
    clusterId String
    The OCID of the SDDC Cluster.
    compartmentId String
    The OCID of the compartment.
    definedTags Map<String>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    displayName String
    A filter to return only resources that match the given display name exactly.
    freeformTags Map<String>
    Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
    id String
    The OCID of the Datastore.
    sddcId String
    The OCID of the SDDC that Datastore is associated with.
    state String
    The lifecycle state of the resource.
    systemTags Map<String>
    Usage of system tag keys. These predefined keys are scoped to namespaces. Example: {orcl-cloud: {free-tier-retain: true}}
    timeCreated String
    The date and time the Datastore was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    timeUpdated String
    The date and time the Datastore was updated, in the format defined by RFC3339.

    GetDatastoresDatastoreCollectionItemBlockVolumeDetail

    Attachments List<GetDatastoresDatastoreCollectionItemBlockVolumeDetailAttachment>
    List of BlockVolumeAttachment objects containing information about attachment details
    Id string
    The OCID of the Datastore.
    Iqn string
    An IQN of the Block Storage Volume.
    Attachments []GetDatastoresDatastoreCollectionItemBlockVolumeDetailAttachment
    List of BlockVolumeAttachment objects containing information about attachment details
    Id string
    The OCID of the Datastore.
    Iqn string
    An IQN of the Block Storage Volume.
    attachments List<GetDatastoresDatastoreCollectionItemBlockVolumeDetailAttachment>
    List of BlockVolumeAttachment objects containing information about attachment details
    id String
    The OCID of the Datastore.
    iqn String
    An IQN of the Block Storage Volume.
    attachments GetDatastoresDatastoreCollectionItemBlockVolumeDetailAttachment[]
    List of BlockVolumeAttachment objects containing information about attachment details
    id string
    The OCID of the Datastore.
    iqn string
    An IQN of the Block Storage Volume.
    attachments Sequence[GetDatastoresDatastoreCollectionItemBlockVolumeDetailAttachment]
    List of BlockVolumeAttachment objects containing information about attachment details
    id str
    The OCID of the Datastore.
    iqn str
    An IQN of the Block Storage Volume.
    attachments List<Property Map>
    List of BlockVolumeAttachment objects containing information about attachment details
    id String
    The OCID of the Datastore.
    iqn String
    An IQN of the Block Storage Volume.

    GetDatastoresDatastoreCollectionItemBlockVolumeDetailAttachment

    EsxiHostId string
    The OCIDs of the ESXi host that block volume is attached to.
    IpAddress string
    The IP address of block volume attachment.
    Port int
    The port of block volume attachment.
    EsxiHostId string
    The OCIDs of the ESXi host that block volume is attached to.
    IpAddress string
    The IP address of block volume attachment.
    Port int
    The port of block volume attachment.
    esxiHostId String
    The OCIDs of the ESXi host that block volume is attached to.
    ipAddress String
    The IP address of block volume attachment.
    port Integer
    The port of block volume attachment.
    esxiHostId string
    The OCIDs of the ESXi host that block volume is attached to.
    ipAddress string
    The IP address of block volume attachment.
    port number
    The port of block volume attachment.
    esxi_host_id str
    The OCIDs of the ESXi host that block volume is attached to.
    ip_address str
    The IP address of block volume attachment.
    port int
    The port of block volume attachment.
    esxiHostId String
    The OCIDs of the ESXi host that block volume is attached to.
    ipAddress String
    The IP address of block volume attachment.
    port Number
    The port of block volume attachment.

    GetDatastoresFilter

    Name string
    Values List<string>
    Regex bool
    Name string
    Values []string
    Regex bool
    name String
    values List<String>
    regex Boolean
    name string
    values string[]
    regex boolean
    name str
    values Sequence[str]
    regex bool
    name String
    values List<String>
    regex Boolean

    Package Details

    Repository
    oci pulumi/pulumi-oci
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the oci Terraform Provider.
    oci logo
    Oracle Cloud Infrastructure v3.10.0 published on Wednesday, Nov 5, 2025 by Pulumi
      Meet Neo: Your AI Platform Teammate