Show / Hide Table of Contents

Class Host

Provides a VMware vSphere host resource. This represents an ESXi host that can be used either as part of a Compute Cluster or Standalone.

Example Usage

Create a standalone host

using Pulumi;
using VSphere = Pulumi.VSphere;

class MyStack : Stack
{
public MyStack()
{
    var dc = Output.Create(VSphere.GetDatacenter.InvokeAsync(new VSphere.GetDatacenterArgs
    {
        Name = "my-datacenter",
    }));
    var h1 = new VSphere.Host("h1", new VSphere.HostArgs
    {
        Hostname = "10.10.10.1",
        Username = "root",
        Password = "password",
        License = "00000-00000-00000-00000i-00000",
        Datacenter = dc.Apply(dc => dc.Id),
    });
}

}

Create host in a compute cluster

using Pulumi;
using VSphere = Pulumi.VSphere;

class MyStack : Stack
{
public MyStack()
{
    var dc = Output.Create(VSphere.GetDatacenter.InvokeAsync(new VSphere.GetDatacenterArgs
    {
        Name = "TfDatacenter",
    }));
    var c1 = dc.Apply(dc => Output.Create(VSphere.GetComputeCluster.InvokeAsync(new VSphere.GetComputeClusterArgs
    {
        Name = "DC0_C0",
        DatacenterId = dc.Id,
    })));
    var h1 = new VSphere.Host("h1", new VSphere.HostArgs
    {
        Hostname = "10.10.10.1",
        Username = "root",
        Password = "password",
        License = "00000-00000-00000-00000i-00000",
        Cluster = c1.Apply(c1 => c1.Id),
    });
}

}

Importing

An existing host can be imported into this resource via supplying the host's ID. An example is below:

using Pulumi;

class MyStack : Stack
{
public MyStack()
{
}

}

The above would import the host with ID host-123.

Inheritance
System.Object
Resource
CustomResource
Host
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.VSphere
Assembly: Pulumi.VSphere.dll
Syntax
public class Host : CustomResource

Constructors

View Source

Host(String, HostArgs, CustomResourceOptions)

Create a Host resource with the given unique name, arguments, and options.

Declaration
public Host(string name, HostArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

HostArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

Cluster

The ID of the Compute Cluster this host should be added to. This should not be set if datacenter is set. Conflicts with: cluster.

Declaration
public Output<string> Cluster { get; }
Property Value
Type Description
Output<System.String>
View Source

ClusterManaged

Can be set to true if compute cluster membership will be managed through the compute_cluster resource rather than thehost resource. Conflicts with: cluster.

Declaration
public Output<bool?> ClusterManaged { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

Connected

If set to false then the host will be disconected. Default is false.

Declaration
public Output<bool?> Connected { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

Datacenter

The ID of the datacenter this host should be added to. This should not be set if cluster is set.

Declaration
public Output<string> Datacenter { get; }
Property Value
Type Description
Output<System.String>
View Source

Force

If set to true then it will force the host to be added, even if the host is already connected to a different vSphere instance. Default is false

Declaration
public Output<bool?> Force { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

Hostname

FQDN or IP address of the host to be added.

Declaration
public Output<string> Hostname { get; }
Property Value
Type Description
Output<System.String>
View Source

License

The license key that will be applied to the host. The license key is expected to be present in vSphere.

Declaration
public Output<string> License { get; }
Property Value
Type Description
Output<System.String>
View Source

Lockdown

Set the lockdown state of the host. Valid options are disabled, normal, and strict. Default is disabled.

Declaration
public Output<string> Lockdown { get; }
Property Value
Type Description
Output<System.String>
View Source

Maintenance

Set the management state of the host. Default is false.

Declaration
public Output<bool?> Maintenance { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

Password

Password that will be used by vSphere to authenticate to the host.

Declaration
public Output<string> Password { get; }
Property Value
Type Description
Output<System.String>
View Source

Thumbprint

Host's certificate SHA-1 thumbprint. If not set the the CA that signed the host's certificate should be trusted. If the CA is not trusted and no thumbprint is set then the operation will fail.

Declaration
public Output<string> Thumbprint { get; }
Property Value
Type Description
Output<System.String>
View Source

Username

Username that will be used by vSphere to authenticate to the host.

Declaration
public Output<string> Username { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, HostState, CustomResourceOptions)

Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.

Declaration
public static Host Get(string name, Input<string> id, HostState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

HostState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
Host
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.