opennebula.Host
Explore with Pulumi AI
Provides an OpenNebula host resource.
This resource allows you to manage hosts on your OpenNebula clusters. When applied, a new host is created. When destroyed, this host is removed.
Example Usage
Create a KVM host with overcommit:
import * as pulumi from "@pulumi/pulumi";
import * as opennebula from "@pulumi/opennebula";
const example = new opennebula.Host("example", {
clusterId: 0,
overcommits: [{
cpu: 3200,
memory: 1048576,
}],
tags: {
environment: "example",
},
type: "kvm",
});
import pulumi
import pulumi_opennebula as opennebula
example = opennebula.Host("example",
cluster_id=0,
overcommits=[{
"cpu": 3200,
"memory": 1048576,
}],
tags={
"environment": "example",
},
type="kvm")
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.NewHost(ctx, "example", &opennebula.HostArgs{
ClusterId: pulumi.Float64(0),
Overcommits: opennebula.HostOvercommitArray{
&opennebula.HostOvercommitArgs{
Cpu: pulumi.Float64(3200),
Memory: pulumi.Float64(1048576),
},
},
Tags: pulumi.StringMap{
"environment": pulumi.String("example"),
},
Type: pulumi.String("kvm"),
})
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.Host("example", new()
{
ClusterId = 0,
Overcommits = new[]
{
new Opennebula.Inputs.HostOvercommitArgs
{
Cpu = 3200,
Memory = 1048576,
},
},
Tags =
{
{ "environment", "example" },
},
Type = "kvm",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.opennebula.Host;
import com.pulumi.opennebula.HostArgs;
import com.pulumi.opennebula.inputs.HostOvercommitArgs;
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 Host("example", HostArgs.builder()
.clusterId(0)
.overcommits(HostOvercommitArgs.builder()
.cpu(3200)
.memory(1048576)
.build())
.tags(Map.of("environment", "example"))
.type("kvm")
.build());
}
}
resources:
example:
type: opennebula:Host
properties:
clusterId: 0
overcommits:
- cpu: 3200
memory: 1.048576e+06
tags:
environment: example
type: kvm
Create a custom host:
import * as pulumi from "@pulumi/pulumi";
import * as opennebula from "@pulumi/opennebula";
const example = new opennebula.Host("example", {
clusterId: 0,
customs: [{
information: "custom",
virtualization: "custom",
}],
tags: {
environment: "example",
},
type: "custom",
});
import pulumi
import pulumi_opennebula as opennebula
example = opennebula.Host("example",
cluster_id=0,
customs=[{
"information": "custom",
"virtualization": "custom",
}],
tags={
"environment": "example",
},
type="custom")
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.NewHost(ctx, "example", &opennebula.HostArgs{
ClusterId: pulumi.Float64(0),
Customs: opennebula.HostCustomArray{
&opennebula.HostCustomArgs{
Information: pulumi.String("custom"),
Virtualization: pulumi.String("custom"),
},
},
Tags: pulumi.StringMap{
"environment": pulumi.String("example"),
},
Type: pulumi.String("custom"),
})
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.Host("example", new()
{
ClusterId = 0,
Customs = new[]
{
new Opennebula.Inputs.HostCustomArgs
{
Information = "custom",
Virtualization = "custom",
},
},
Tags =
{
{ "environment", "example" },
},
Type = "custom",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.opennebula.Host;
import com.pulumi.opennebula.HostArgs;
import com.pulumi.opennebula.inputs.HostCustomArgs;
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 Host("example", HostArgs.builder()
.clusterId(0)
.customs(HostCustomArgs.builder()
.information("custom")
.virtualization("custom")
.build())
.tags(Map.of("environment", "example"))
.type("custom")
.build());
}
}
resources:
example:
type: opennebula:Host
properties:
clusterId: 0
customs:
- information: custom
virtualization: custom
tags:
environment: example
type: custom
Create Host Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Host(name: string, args: HostArgs, opts?: CustomResourceOptions);
@overload
def Host(resource_name: str,
args: HostArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Host(resource_name: str,
opts: Optional[ResourceOptions] = None,
type: Optional[str] = None,
cluster_id: Optional[float] = None,
customs: Optional[Sequence[HostCustomArgs]] = None,
host_id: Optional[str] = None,
name: Optional[str] = None,
overcommits: Optional[Sequence[HostOvercommitArgs]] = None,
tags: Optional[Mapping[str, str]] = None,
timeouts: Optional[HostTimeoutsArgs] = None)
func NewHost(ctx *Context, name string, args HostArgs, opts ...ResourceOption) (*Host, error)
public Host(string name, HostArgs args, CustomResourceOptions? opts = null)
type: opennebula:Host
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 HostArgs
- 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 HostArgs
- 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 HostArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args HostArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args HostArgs
- 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 hostResource = new Opennebula.Host("hostResource", new()
{
Type = "string",
ClusterId = 0,
Customs = new[]
{
new Opennebula.Inputs.HostCustomArgs
{
Information = "string",
Virtualization = "string",
},
},
HostId = "string",
Name = "string",
Overcommits = new[]
{
new Opennebula.Inputs.HostOvercommitArgs
{
Cpu = 0,
Memory = 0,
},
},
Tags =
{
{ "string", "string" },
},
Timeouts = new Opennebula.Inputs.HostTimeoutsArgs
{
Create = "string",
Delete = "string",
},
});
example, err := opennebula.NewHost(ctx, "hostResource", &opennebula.HostArgs{
Type: pulumi.String("string"),
ClusterId: pulumi.Float64(0),
Customs: opennebula.HostCustomArray{
&opennebula.HostCustomArgs{
Information: pulumi.String("string"),
Virtualization: pulumi.String("string"),
},
},
HostId: pulumi.String("string"),
Name: pulumi.String("string"),
Overcommits: opennebula.HostOvercommitArray{
&opennebula.HostOvercommitArgs{
Cpu: pulumi.Float64(0),
Memory: pulumi.Float64(0),
},
},
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
Timeouts: &opennebula.HostTimeoutsArgs{
Create: pulumi.String("string"),
Delete: pulumi.String("string"),
},
})
var hostResource = new Host("hostResource", HostArgs.builder()
.type("string")
.clusterId(0)
.customs(HostCustomArgs.builder()
.information("string")
.virtualization("string")
.build())
.hostId("string")
.name("string")
.overcommits(HostOvercommitArgs.builder()
.cpu(0)
.memory(0)
.build())
.tags(Map.of("string", "string"))
.timeouts(HostTimeoutsArgs.builder()
.create("string")
.delete("string")
.build())
.build());
host_resource = opennebula.Host("hostResource",
type="string",
cluster_id=0,
customs=[{
"information": "string",
"virtualization": "string",
}],
host_id="string",
name="string",
overcommits=[{
"cpu": 0,
"memory": 0,
}],
tags={
"string": "string",
},
timeouts={
"create": "string",
"delete": "string",
})
const hostResource = new opennebula.Host("hostResource", {
type: "string",
clusterId: 0,
customs: [{
information: "string",
virtualization: "string",
}],
hostId: "string",
name: "string",
overcommits: [{
cpu: 0,
memory: 0,
}],
tags: {
string: "string",
},
timeouts: {
create: "string",
"delete": "string",
},
});
type: opennebula:Host
properties:
clusterId: 0
customs:
- information: string
virtualization: string
hostId: string
name: string
overcommits:
- cpu: 0
memory: 0
tags:
string: string
timeouts:
create: string
delete: string
type: string
Host 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 Host resource accepts the following input properties:
- Type string
- Type of the new host: kvm, qemu, lxd, lxc, firecracker, custom. For now vcenter type is not managed by the provider.
- Cluster
Id double - ID of the cluster the host is part of.
- Customs
List<Host
Custom> - If
type="custom"
this section should be defined, see Custom section for details. - Host
Id string - ID of the host.
- Name string
- The name of the host.
- Overcommits
List<Host
Overcommit> - This section allow to increase the allocatable capacity of the host. See Overcommit
- Dictionary<string, string>
- Map of tags (
key=value
) assigned to the resource. Override matching tags present in thedefault_tags
atribute when configured in theprovider
block. See tags usage related documentation for more information. - Timeouts
Host
Timeouts
- Type string
- Type of the new host: kvm, qemu, lxd, lxc, firecracker, custom. For now vcenter type is not managed by the provider.
- Cluster
Id float64 - ID of the cluster the host is part of.
- Customs
[]Host
Custom Args - If
type="custom"
this section should be defined, see Custom section for details. - Host
Id string - ID of the host.
- Name string
- The name of the host.
- Overcommits
[]Host
Overcommit Args - This section allow to increase the allocatable capacity of the host. See Overcommit
- map[string]string
- Map of tags (
key=value
) assigned to the resource. Override matching tags present in thedefault_tags
atribute when configured in theprovider
block. See tags usage related documentation for more information. - Timeouts
Host
Timeouts Args
- type String
- Type of the new host: kvm, qemu, lxd, lxc, firecracker, custom. For now vcenter type is not managed by the provider.
- cluster
Id Double - ID of the cluster the host is part of.
- customs
List<Host
Custom> - If
type="custom"
this section should be defined, see Custom section for details. - host
Id String - ID of the host.
- name String
- The name of the host.
- overcommits
List<Host
Overcommit> - This section allow to increase the allocatable capacity of the host. See Overcommit
- Map<String,String>
- Map of tags (
key=value
) assigned to the resource. Override matching tags present in thedefault_tags
atribute when configured in theprovider
block. See tags usage related documentation for more information. - timeouts
Host
Timeouts
- type string
- Type of the new host: kvm, qemu, lxd, lxc, firecracker, custom. For now vcenter type is not managed by the provider.
- cluster
Id number - ID of the cluster the host is part of.
- customs
Host
Custom[] - If
type="custom"
this section should be defined, see Custom section for details. - host
Id string - ID of the host.
- name string
- The name of the host.
- overcommits
Host
Overcommit[] - This section allow to increase the allocatable capacity of the host. See Overcommit
- {[key: string]: string}
- Map of tags (
key=value
) assigned to the resource. Override matching tags present in thedefault_tags
atribute when configured in theprovider
block. See tags usage related documentation for more information. - timeouts
Host
Timeouts
- type str
- Type of the new host: kvm, qemu, lxd, lxc, firecracker, custom. For now vcenter type is not managed by the provider.
- cluster_
id float - ID of the cluster the host is part of.
- customs
Sequence[Host
Custom Args] - If
type="custom"
this section should be defined, see Custom section for details. - host_
id str - ID of the host.
- name str
- The name of the host.
- overcommits
Sequence[Host
Overcommit Args] - This section allow to increase the allocatable capacity of the host. See Overcommit
- Mapping[str, str]
- Map of tags (
key=value
) assigned to the resource. Override matching tags present in thedefault_tags
atribute when configured in theprovider
block. See tags usage related documentation for more information. - timeouts
Host
Timeouts Args
- type String
- Type of the new host: kvm, qemu, lxd, lxc, firecracker, custom. For now vcenter type is not managed by the provider.
- cluster
Id Number - ID of the cluster the host is part of.
- customs List<Property Map>
- If
type="custom"
this section should be defined, see Custom section for details. - host
Id String - ID of the host.
- name String
- The name of the host.
- overcommits List<Property Map>
- This section allow to increase the allocatable capacity of the host. See Overcommit
- Map<String>
- Map of tags (
key=value
) assigned to the resource. Override matching tags present in thedefault_tags
atribute when configured in theprovider
block. See tags usage related documentation for more information. - timeouts Property Map
Outputs
All input properties are implicitly available as output properties. Additionally, the Host resource produces the following output properties:
- Dictionary<string, string>
- Default tags defined in the provider configuration.
- Id string
- The provider-assigned unique ID for this managed resource.
- Dictionary<string, string>
- Result of the applied
default_tags
and then resourcetags
.
- map[string]string
- Default tags defined in the provider configuration.
- Id string
- The provider-assigned unique ID for this managed resource.
- map[string]string
- Result of the applied
default_tags
and then resourcetags
.
- Map<String,String>
- Default tags defined in the provider configuration.
- id String
- The provider-assigned unique ID for this managed resource.
- Map<String,String>
- Result of the applied
default_tags
and then resourcetags
.
- {[key: string]: string}
- Default tags defined in the provider configuration.
- id string
- The provider-assigned unique ID for this managed resource.
- {[key: string]: string}
- Result of the applied
default_tags
and then resourcetags
.
- Mapping[str, str]
- Default tags defined in the provider configuration.
- id str
- The provider-assigned unique ID for this managed resource.
- Mapping[str, str]
- Result of the applied
default_tags
and then resourcetags
.
- Map<String>
- Default tags defined in the provider configuration.
- id String
- The provider-assigned unique ID for this managed resource.
- Map<String>
- Result of the applied
default_tags
and then resourcetags
.
Look up Existing Host Resource
Get an existing Host 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?: HostState, opts?: CustomResourceOptions): Host
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
cluster_id: Optional[float] = None,
customs: Optional[Sequence[HostCustomArgs]] = None,
default_tags: Optional[Mapping[str, str]] = None,
host_id: Optional[str] = None,
name: Optional[str] = None,
overcommits: Optional[Sequence[HostOvercommitArgs]] = None,
tags: Optional[Mapping[str, str]] = None,
tags_all: Optional[Mapping[str, str]] = None,
timeouts: Optional[HostTimeoutsArgs] = None,
type: Optional[str] = None) -> Host
func GetHost(ctx *Context, name string, id IDInput, state *HostState, opts ...ResourceOption) (*Host, error)
public static Host Get(string name, Input<string> id, HostState? state, CustomResourceOptions? opts = null)
public static Host get(String name, Output<String> id, HostState state, CustomResourceOptions options)
resources: _: type: opennebula:Host 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.
- Cluster
Id double - ID of the cluster the host is part of.
- Customs
List<Host
Custom> - If
type="custom"
this section should be defined, see Custom section for details. - Dictionary<string, string>
- Default tags defined in the provider configuration.
- Host
Id string - ID of the host.
- Name string
- The name of the host.
- Overcommits
List<Host
Overcommit> - This section allow to increase the allocatable capacity of the host. See Overcommit
- Dictionary<string, string>
- Map of tags (
key=value
) assigned to the resource. Override matching tags present in thedefault_tags
atribute when configured in theprovider
block. See tags usage related documentation for more information. - Dictionary<string, string>
- Result of the applied
default_tags
and then resourcetags
. - Timeouts
Host
Timeouts - Type string
- Type of the new host: kvm, qemu, lxd, lxc, firecracker, custom. For now vcenter type is not managed by the provider.
- Cluster
Id float64 - ID of the cluster the host is part of.
- Customs
[]Host
Custom Args - If
type="custom"
this section should be defined, see Custom section for details. - map[string]string
- Default tags defined in the provider configuration.
- Host
Id string - ID of the host.
- Name string
- The name of the host.
- Overcommits
[]Host
Overcommit Args - This section allow to increase the allocatable capacity of the host. See Overcommit
- map[string]string
- Map of tags (
key=value
) assigned to the resource. Override matching tags present in thedefault_tags
atribute when configured in theprovider
block. See tags usage related documentation for more information. - map[string]string
- Result of the applied
default_tags
and then resourcetags
. - Timeouts
Host
Timeouts Args - Type string
- Type of the new host: kvm, qemu, lxd, lxc, firecracker, custom. For now vcenter type is not managed by the provider.
- cluster
Id Double - ID of the cluster the host is part of.
- customs
List<Host
Custom> - If
type="custom"
this section should be defined, see Custom section for details. - Map<String,String>
- Default tags defined in the provider configuration.
- host
Id String - ID of the host.
- name String
- The name of the host.
- overcommits
List<Host
Overcommit> - This section allow to increase the allocatable capacity of the host. See Overcommit
- Map<String,String>
- Map of tags (
key=value
) assigned to the resource. Override matching tags present in thedefault_tags
atribute when configured in theprovider
block. See tags usage related documentation for more information. - Map<String,String>
- Result of the applied
default_tags
and then resourcetags
. - timeouts
Host
Timeouts - type String
- Type of the new host: kvm, qemu, lxd, lxc, firecracker, custom. For now vcenter type is not managed by the provider.
- cluster
Id number - ID of the cluster the host is part of.
- customs
Host
Custom[] - If
type="custom"
this section should be defined, see Custom section for details. - {[key: string]: string}
- Default tags defined in the provider configuration.
- host
Id string - ID of the host.
- name string
- The name of the host.
- overcommits
Host
Overcommit[] - This section allow to increase the allocatable capacity of the host. See Overcommit
- {[key: string]: string}
- Map of tags (
key=value
) assigned to the resource. Override matching tags present in thedefault_tags
atribute when configured in theprovider
block. See tags usage related documentation for more information. - {[key: string]: string}
- Result of the applied
default_tags
and then resourcetags
. - timeouts
Host
Timeouts - type string
- Type of the new host: kvm, qemu, lxd, lxc, firecracker, custom. For now vcenter type is not managed by the provider.
- cluster_
id float - ID of the cluster the host is part of.
- customs
Sequence[Host
Custom Args] - If
type="custom"
this section should be defined, see Custom section for details. - Mapping[str, str]
- Default tags defined in the provider configuration.
- host_
id str - ID of the host.
- name str
- The name of the host.
- overcommits
Sequence[Host
Overcommit Args] - This section allow to increase the allocatable capacity of the host. See Overcommit
- Mapping[str, str]
- Map of tags (
key=value
) assigned to the resource. Override matching tags present in thedefault_tags
atribute when configured in theprovider
block. See tags usage related documentation for more information. - Mapping[str, str]
- Result of the applied
default_tags
and then resourcetags
. - timeouts
Host
Timeouts Args - type str
- Type of the new host: kvm, qemu, lxd, lxc, firecracker, custom. For now vcenter type is not managed by the provider.
- cluster
Id Number - ID of the cluster the host is part of.
- customs List<Property Map>
- If
type="custom"
this section should be defined, see Custom section for details. - Map<String>
- Default tags defined in the provider configuration.
- host
Id String - ID of the host.
- name String
- The name of the host.
- overcommits List<Property Map>
- This section allow to increase the allocatable capacity of the host. See Overcommit
- Map<String>
- Map of tags (
key=value
) assigned to the resource. Override matching tags present in thedefault_tags
atribute when configured in theprovider
block. See tags usage related documentation for more information. - Map<String>
- Result of the applied
default_tags
and then resourcetags
. - timeouts Property Map
- type String
- Type of the new host: kvm, qemu, lxd, lxc, firecracker, custom. For now vcenter type is not managed by the provider.
Supporting Types
HostCustom, HostCustomArgs
- Information string
- name of the information driver (named
IM_MAD
in opennebula) - Virtualization string
- name of the virtualization driver (named
VM_MAD
in OpenNebula)
- Information string
- name of the information driver (named
IM_MAD
in opennebula) - Virtualization string
- name of the virtualization driver (named
VM_MAD
in OpenNebula)
- information String
- name of the information driver (named
IM_MAD
in opennebula) - virtualization String
- name of the virtualization driver (named
VM_MAD
in OpenNebula)
- information string
- name of the information driver (named
IM_MAD
in opennebula) - virtualization string
- name of the virtualization driver (named
VM_MAD
in OpenNebula)
- information str
- name of the information driver (named
IM_MAD
in opennebula) - virtualization str
- name of the virtualization driver (named
VM_MAD
in OpenNebula)
- information String
- name of the information driver (named
IM_MAD
in opennebula) - virtualization String
- name of the virtualization driver (named
VM_MAD
in OpenNebula)
HostOvercommit, HostOvercommitArgs
HostTimeouts, HostTimeoutsArgs
Import
opennebula_host
can be imported using its ID:
$ pulumi import opennebula:index/host:Host 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.