opennebula.VirtualDataCenter
Explore with Pulumi AI
Provides an OpenNebula virtual data center resource.
This resource allows you to manage virtual data centers on your OpenNebula organization. When applied, a new virtual data center is created. When destroyed, this virtual data center is removed.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as opennebula from "@pulumi/opennebula";
const example = new opennebula.VirtualDataCenter("example", {
groupIds: [opennebula_group.example.id],
zones: [{
id: 0,
hostIds: [
0,
1,
],
datastoreIds: [
0,
1,
2,
],
vnetIds: [opennebula_virtual_network.example.id],
clusterIds: [
0,
100,
],
}],
});
import pulumi
import pulumi_opennebula as opennebula
example = opennebula.VirtualDataCenter("example",
group_ids=[opennebula_group["example"]["id"]],
zones=[{
"id": 0,
"host_ids": [
0,
1,
],
"datastore_ids": [
0,
1,
2,
],
"vnet_ids": [opennebula_virtual_network["example"]["id"]],
"cluster_ids": [
0,
100,
],
}])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/opennebula/opennebula"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := opennebula.NewVirtualDataCenter(ctx, "example", &opennebula.VirtualDataCenterArgs{
GroupIds: pulumi.Float64Array{
opennebula_group.Example.Id,
},
Zones: opennebula.VirtualDataCenterZoneArray{
&opennebula.VirtualDataCenterZoneArgs{
Id: pulumi.Float64(0),
HostIds: pulumi.Float64Array{
pulumi.Float64(0),
pulumi.Float64(1),
},
DatastoreIds: pulumi.Float64Array{
pulumi.Float64(0),
pulumi.Float64(1),
pulumi.Float64(2),
},
VnetIds: pulumi.Float64Array{
opennebula_virtual_network.Example.Id,
},
ClusterIds: pulumi.Float64Array{
pulumi.Float64(0),
pulumi.Float64(100),
},
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Opennebula = Pulumi.Opennebula;
return await Deployment.RunAsync(() =>
{
var example = new Opennebula.VirtualDataCenter("example", new()
{
GroupIds = new[]
{
opennebula_group.Example.Id,
},
Zones = new[]
{
new Opennebula.Inputs.VirtualDataCenterZoneArgs
{
Id = 0,
HostIds = new[]
{
0,
1,
},
DatastoreIds = new[]
{
0,
1,
2,
},
VnetIds = new[]
{
opennebula_virtual_network.Example.Id,
},
ClusterIds = new[]
{
0,
100,
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.opennebula.VirtualDataCenter;
import com.pulumi.opennebula.VirtualDataCenterArgs;
import com.pulumi.opennebula.inputs.VirtualDataCenterZoneArgs;
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 example = new VirtualDataCenter("example", VirtualDataCenterArgs.builder()
.groupIds(opennebula_group.example().id())
.zones(VirtualDataCenterZoneArgs.builder()
.id(0)
.hostIds(
0,
1)
.datastoreIds(
0,
1,
2)
.vnetIds(opennebula_virtual_network.example().id())
.clusterIds(
0,
100)
.build())
.build());
}
}
resources:
example:
type: opennebula:VirtualDataCenter
properties:
groupIds:
- ${opennebula_group.example.id}
zones:
- id: 0
hostIds:
- 0
- 1
datastoreIds:
- 0
- 1
- 2
vnetIds:
- ${opennebula_virtual_network.example.id}
clusterIds:
- 0
- 100
Create VirtualDataCenter Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new VirtualDataCenter(name: string, args?: VirtualDataCenterArgs, opts?: CustomResourceOptions);
@overload
def VirtualDataCenter(resource_name: str,
args: Optional[VirtualDataCenterArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def VirtualDataCenter(resource_name: str,
opts: Optional[ResourceOptions] = None,
group_ids: Optional[Sequence[float]] = None,
name: Optional[str] = None,
virtual_data_center_id: Optional[str] = None,
zones: Optional[Sequence[VirtualDataCenterZoneArgs]] = None)
func NewVirtualDataCenter(ctx *Context, name string, args *VirtualDataCenterArgs, opts ...ResourceOption) (*VirtualDataCenter, error)
public VirtualDataCenter(string name, VirtualDataCenterArgs? args = null, CustomResourceOptions? opts = null)
public VirtualDataCenter(String name, VirtualDataCenterArgs args)
public VirtualDataCenter(String name, VirtualDataCenterArgs args, CustomResourceOptions options)
type: opennebula:VirtualDataCenter
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 VirtualDataCenterArgs
- 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 VirtualDataCenterArgs
- 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 VirtualDataCenterArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VirtualDataCenterArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args VirtualDataCenterArgs
- 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 virtualDataCenterResource = new Opennebula.VirtualDataCenter("virtualDataCenterResource", new()
{
GroupIds = new[]
{
0,
},
Name = "string",
VirtualDataCenterId = "string",
Zones = new[]
{
new Opennebula.Inputs.VirtualDataCenterZoneArgs
{
ClusterIds = new[]
{
0,
},
DatastoreIds = new[]
{
0,
},
HostIds = new[]
{
0,
},
Id = 0,
VnetIds = new[]
{
0,
},
},
},
});
example, err := opennebula.NewVirtualDataCenter(ctx, "virtualDataCenterResource", &opennebula.VirtualDataCenterArgs{
GroupIds: pulumi.Float64Array{
pulumi.Float64(0),
},
Name: pulumi.String("string"),
VirtualDataCenterId: pulumi.String("string"),
Zones: opennebula.VirtualDataCenterZoneArray{
&opennebula.VirtualDataCenterZoneArgs{
ClusterIds: pulumi.Float64Array{
pulumi.Float64(0),
},
DatastoreIds: pulumi.Float64Array{
pulumi.Float64(0),
},
HostIds: pulumi.Float64Array{
pulumi.Float64(0),
},
Id: pulumi.Float64(0),
VnetIds: pulumi.Float64Array{
pulumi.Float64(0),
},
},
},
})
var virtualDataCenterResource = new VirtualDataCenter("virtualDataCenterResource", VirtualDataCenterArgs.builder()
.groupIds(0)
.name("string")
.virtualDataCenterId("string")
.zones(VirtualDataCenterZoneArgs.builder()
.clusterIds(0)
.datastoreIds(0)
.hostIds(0)
.id(0)
.vnetIds(0)
.build())
.build());
virtual_data_center_resource = opennebula.VirtualDataCenter("virtualDataCenterResource",
group_ids=[0],
name="string",
virtual_data_center_id="string",
zones=[{
"cluster_ids": [0],
"datastore_ids": [0],
"host_ids": [0],
"id": 0,
"vnet_ids": [0],
}])
const virtualDataCenterResource = new opennebula.VirtualDataCenter("virtualDataCenterResource", {
groupIds: [0],
name: "string",
virtualDataCenterId: "string",
zones: [{
clusterIds: [0],
datastoreIds: [0],
hostIds: [0],
id: 0,
vnetIds: [0],
}],
});
type: opennebula:VirtualDataCenter
properties:
groupIds:
- 0
name: string
virtualDataCenterId: string
zones:
- clusterIds:
- 0
datastoreIds:
- 0
hostIds:
- 0
id: 0
vnetIds:
- 0
VirtualDataCenter 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 VirtualDataCenter resource accepts the following input properties:
- Group
Ids List<double> - List of Group IDs to be added into the VDC
- Name string
- The name of the virtual data center.
- Virtual
Data stringCenter Id - ID of the virtual data center.
- Zones
List<Virtual
Data Center Zone> - List of zones. See Zones parameters below for details
- Group
Ids []float64 - List of Group IDs to be added into the VDC
- Name string
- The name of the virtual data center.
- Virtual
Data stringCenter Id - ID of the virtual data center.
- Zones
[]Virtual
Data Center Zone Args - List of zones. See Zones parameters below for details
- group
Ids List<Double> - List of Group IDs to be added into the VDC
- name String
- The name of the virtual data center.
- virtual
Data StringCenter Id - ID of the virtual data center.
- zones
List<Virtual
Data Center Zone> - List of zones. See Zones parameters below for details
- group
Ids number[] - List of Group IDs to be added into the VDC
- name string
- The name of the virtual data center.
- virtual
Data stringCenter Id - ID of the virtual data center.
- zones
Virtual
Data Center Zone[] - List of zones. See Zones parameters below for details
- group_
ids Sequence[float] - List of Group IDs to be added into the VDC
- name str
- The name of the virtual data center.
- virtual_
data_ strcenter_ id - ID of the virtual data center.
- zones
Sequence[Virtual
Data Center Zone Args] - List of zones. See Zones parameters below for details
- group
Ids List<Number> - List of Group IDs to be added into the VDC
- name String
- The name of the virtual data center.
- virtual
Data StringCenter Id - ID of the virtual data center.
- zones List<Property Map>
- List of zones. See Zones parameters below for details
Outputs
All input properties are implicitly available as output properties. Additionally, the VirtualDataCenter 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 VirtualDataCenter Resource
Get an existing VirtualDataCenter 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?: VirtualDataCenterState, opts?: CustomResourceOptions): VirtualDataCenter
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
group_ids: Optional[Sequence[float]] = None,
name: Optional[str] = None,
virtual_data_center_id: Optional[str] = None,
zones: Optional[Sequence[VirtualDataCenterZoneArgs]] = None) -> VirtualDataCenter
func GetVirtualDataCenter(ctx *Context, name string, id IDInput, state *VirtualDataCenterState, opts ...ResourceOption) (*VirtualDataCenter, error)
public static VirtualDataCenter Get(string name, Input<string> id, VirtualDataCenterState? state, CustomResourceOptions? opts = null)
public static VirtualDataCenter get(String name, Output<String> id, VirtualDataCenterState state, CustomResourceOptions options)
resources: _: type: opennebula:VirtualDataCenter 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.
- Group
Ids List<double> - List of Group IDs to be added into the VDC
- Name string
- The name of the virtual data center.
- Virtual
Data stringCenter Id - ID of the virtual data center.
- Zones
List<Virtual
Data Center Zone> - List of zones. See Zones parameters below for details
- Group
Ids []float64 - List of Group IDs to be added into the VDC
- Name string
- The name of the virtual data center.
- Virtual
Data stringCenter Id - ID of the virtual data center.
- Zones
[]Virtual
Data Center Zone Args - List of zones. See Zones parameters below for details
- group
Ids List<Double> - List of Group IDs to be added into the VDC
- name String
- The name of the virtual data center.
- virtual
Data StringCenter Id - ID of the virtual data center.
- zones
List<Virtual
Data Center Zone> - List of zones. See Zones parameters below for details
- group
Ids number[] - List of Group IDs to be added into the VDC
- name string
- The name of the virtual data center.
- virtual
Data stringCenter Id - ID of the virtual data center.
- zones
Virtual
Data Center Zone[] - List of zones. See Zones parameters below for details
- group_
ids Sequence[float] - List of Group IDs to be added into the VDC
- name str
- The name of the virtual data center.
- virtual_
data_ strcenter_ id - ID of the virtual data center.
- zones
Sequence[Virtual
Data Center Zone Args] - List of zones. See Zones parameters below for details
- group
Ids List<Number> - List of Group IDs to be added into the VDC
- name String
- The name of the virtual data center.
- virtual
Data StringCenter Id - ID of the virtual data center.
- zones List<Property Map>
- List of zones. See Zones parameters below for details
Supporting Types
VirtualDataCenterZone, VirtualDataCenterZoneArgs
- Cluster
Ids List<double> - List of clusters from Zone ID to add in virtual data center.
- Datastore
Ids List<double> - List of datastore from Zone ID to add in virtual data center.
- Host
Ids List<double> - List of hosts from Zone ID to add in virtual data center.
- Id double
- Zone ID from where resource to add in virtual data center are located. Defaults to 0.
- Vnet
Ids List<double> - List of virtual networks from Zone ID to add in virtual data center.
- Cluster
Ids []float64 - List of clusters from Zone ID to add in virtual data center.
- Datastore
Ids []float64 - List of datastore from Zone ID to add in virtual data center.
- Host
Ids []float64 - List of hosts from Zone ID to add in virtual data center.
- Id float64
- Zone ID from where resource to add in virtual data center are located. Defaults to 0.
- Vnet
Ids []float64 - List of virtual networks from Zone ID to add in virtual data center.
- cluster
Ids List<Double> - List of clusters from Zone ID to add in virtual data center.
- datastore
Ids List<Double> - List of datastore from Zone ID to add in virtual data center.
- host
Ids List<Double> - List of hosts from Zone ID to add in virtual data center.
- id Double
- Zone ID from where resource to add in virtual data center are located. Defaults to 0.
- vnet
Ids List<Double> - List of virtual networks from Zone ID to add in virtual data center.
- cluster
Ids number[] - List of clusters from Zone ID to add in virtual data center.
- datastore
Ids number[] - List of datastore from Zone ID to add in virtual data center.
- host
Ids number[] - List of hosts from Zone ID to add in virtual data center.
- id number
- Zone ID from where resource to add in virtual data center are located. Defaults to 0.
- vnet
Ids number[] - List of virtual networks from Zone ID to add in virtual data center.
- cluster_
ids Sequence[float] - List of clusters from Zone ID to add in virtual data center.
- datastore_
ids Sequence[float] - List of datastore from Zone ID to add in virtual data center.
- host_
ids Sequence[float] - List of hosts from Zone ID to add in virtual data center.
- id float
- Zone ID from where resource to add in virtual data center are located. Defaults to 0.
- vnet_
ids Sequence[float] - List of virtual networks from Zone ID to add in virtual data center.
- cluster
Ids List<Number> - List of clusters from Zone ID to add in virtual data center.
- datastore
Ids List<Number> - List of datastore from Zone ID to add in virtual data center.
- host
Ids List<Number> - List of hosts from Zone ID to add in virtual data center.
- id Number
- Zone ID from where resource to add in virtual data center are located. Defaults to 0.
- vnet
Ids List<Number> - List of virtual networks from Zone ID to add in virtual data center.
Import
opennebula_virtual_data_center
can be imported using its ID:
$ pulumi import opennebula:index/virtualDataCenter:VirtualDataCenter example 123
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- opennebula opennebula/terraform-provider-opennebula
- License
- Notes
- This Pulumi package is based on the
opennebula
Terraform Provider.