VirtualMachine

class VirtualMachine : KotlinCustomResource

A virtual machine. Uses Azure REST API version 2018-09-15. In version 2.x of the Azure Native provider, it used API version 2018-09-15.

Example Usage

VirtualMachines_CreateOrUpdate

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var virtualMachine = new AzureNative.DevTestLab.VirtualMachine("virtualMachine", new()
{
AllowClaim = true,
DisallowPublicIpAddress = true,
GalleryImageReference = new AzureNative.DevTestLab.Inputs.GalleryImageReferenceArgs
{
Offer = "UbuntuServer",
OsType = "Linux",
Publisher = "Canonical",
Sku = "16.04-LTS",
Version = "Latest",
},
LabName = "{labName}",
LabSubnetName = "{virtualNetworkName}Subnet",
LabVirtualNetworkId = "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualnetworks/{virtualNetworkName}",
Location = "{location}",
Name = "{vmName}",
Password = "{userPassword}",
ResourceGroupName = "resourceGroupName",
Size = "Standard_A2_v2",
StorageType = "Standard",
Tags =
{
{ "tagName1", "tagValue1" },
},
UserName = "{userName}",
});
});
package main
import (
devtestlab "github.com/pulumi/pulumi-azure-native-sdk/devtestlab/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := devtestlab.NewVirtualMachine(ctx, "virtualMachine", &devtestlab.VirtualMachineArgs{
AllowClaim: pulumi.Bool(true),
DisallowPublicIpAddress: pulumi.Bool(true),
GalleryImageReference: &devtestlab.GalleryImageReferenceArgs{
Offer: pulumi.String("UbuntuServer"),
OsType: pulumi.String("Linux"),
Publisher: pulumi.String("Canonical"),
Sku: pulumi.String("16.04-LTS"),
Version: pulumi.String("Latest"),
},
LabName: pulumi.String("{labName}"),
LabSubnetName: pulumi.String("{virtualNetworkName}Subnet"),
LabVirtualNetworkId: pulumi.String("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualnetworks/{virtualNetworkName}"),
Location: pulumi.String("{location}"),
Name: pulumi.String("{vmName}"),
Password: pulumi.String("{userPassword}"),
ResourceGroupName: pulumi.String("resourceGroupName"),
Size: pulumi.String("Standard_A2_v2"),
StorageType: pulumi.String("Standard"),
Tags: pulumi.StringMap{
"tagName1": pulumi.String("tagValue1"),
},
UserName: pulumi.String("{userName}"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.devtestlab.VirtualMachine;
import com.pulumi.azurenative.devtestlab.VirtualMachineArgs;
import com.pulumi.azurenative.devtestlab.inputs.GalleryImageReferenceArgs;
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 virtualMachine = new VirtualMachine("virtualMachine", VirtualMachineArgs.builder()
.allowClaim(true)
.disallowPublicIpAddress(true)
.galleryImageReference(GalleryImageReferenceArgs.builder()
.offer("UbuntuServer")
.osType("Linux")
.publisher("Canonical")
.sku("16.04-LTS")
.version("Latest")
.build())
.labName("{labName}")
.labSubnetName("{virtualNetworkName}Subnet")
.labVirtualNetworkId("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualnetworks/{virtualNetworkName}")
.location("{location}")
.name("{vmName}")
.password("{userPassword}")
.resourceGroupName("resourceGroupName")
.size("Standard_A2_v2")
.storageType("Standard")
.tags(Map.of("tagName1", "tagValue1"))
.userName("{userName}")
.build());
}
}

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:devtestlab:VirtualMachine {vmName} /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}

Properties

Link copied to clipboard
val allowClaim: Output<Boolean>?

Indicates whether another user can take ownership of the virtual machine

Link copied to clipboard

The applicable schedule for the virtual machine.

Link copied to clipboard

The artifact deployment status for the virtual machine.

Link copied to clipboard

The artifacts to be installed on the virtual machine.

Link copied to clipboard
val azureApiVersion: Output<String>

The Azure API version of the resource.

Link copied to clipboard
val computeId: Output<String>

The resource identifier (Microsoft.Compute) of the virtual machine.

Link copied to clipboard

The compute virtual machine properties.

Link copied to clipboard
val createdByUser: Output<String>

The email address of creator of the virtual machine.

Link copied to clipboard
val createdByUserId: Output<String>

The object identifier of the creator of the virtual machine.

Link copied to clipboard
val createdDate: Output<String>?

The creation date of the virtual machine.

Link copied to clipboard
val customImageId: Output<String>?

The custom image identifier of the virtual machine.

Link copied to clipboard

New or existing data disks to attach to the virtual machine after creation

Link copied to clipboard

Indicates whether the virtual machine is to be created without a public IP address.

Link copied to clipboard
val environmentId: Output<String>?

The resource ID of the environment that contains this virtual machine, if any.

Link copied to clipboard
val expirationDate: Output<String>?

The expiration date for VM.

Link copied to clipboard
val fqdn: Output<String>

The fully-qualified domain name of the virtual machine.

Link copied to clipboard

The Microsoft Azure Marketplace image reference of the virtual machine.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

Indicates whether this virtual machine uses an SSH key for authentication.

Link copied to clipboard
val labSubnetName: Output<String>?

The lab subnet name of the virtual machine.

Link copied to clipboard

The lab virtual network identifier of the virtual machine.

Link copied to clipboard

Last known compute power state captured in DTL

Link copied to clipboard
val location: Output<String>?

The location of the resource.

Link copied to clipboard
val name: Output<String>

The name of the resource.

Link copied to clipboard

The network interface properties.

Link copied to clipboard
val notes: Output<String>?

The notes of the virtual machine.

Link copied to clipboard
val osType: Output<String>

The OS type of the virtual machine.

Link copied to clipboard
val ownerObjectId: Output<String>?

The object identifier of the owner of the virtual machine.

Link copied to clipboard

The user principal name of the virtual machine owner.

Link copied to clipboard
val password: Output<String>?

The password of the virtual machine administrator.

Link copied to clipboard
val planId: Output<String>?

The id of the plan associated with the virtual machine image

Link copied to clipboard

The provisioning status of the resource.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Virtual Machine schedules to be created

Link copied to clipboard
val size: Output<String>?

The size of the virtual machine.

Link copied to clipboard
val sshKey: Output<String>?

The SSH key of the virtual machine administrator.

Link copied to clipboard
val storageType: Output<String>?

Storage type to use for virtual machine (i.e. Standard, Premium).

Link copied to clipboard
val tags: Output<Map<String, String>>?

The tags of the resource.

Link copied to clipboard
val type: Output<String>

The type of the resource.

Link copied to clipboard

The unique immutable identifier of a resource (Guid).

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val userName: Output<String>?

The user name of the virtual machine.

Link copied to clipboard

Tells source of creation of lab virtual machine. Output property only.