Virtual Machine
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
Indicates whether another user can take ownership of the virtual machine
The applicable schedule for the virtual machine.
The artifact deployment status for the virtual machine.
The artifacts to be installed on the virtual machine.
The Azure API version of the resource.
The compute virtual machine properties.
The email address of creator of the virtual machine.
The object identifier of the creator of the virtual machine.
The creation date of the virtual machine.
The custom image identifier of the virtual machine.
New or existing data disks to attach to the virtual machine after creation
Indicates whether the virtual machine is to be created without a public IP address.
The resource ID of the environment that contains this virtual machine, if any.
The expiration date for VM.
The Microsoft Azure Marketplace image reference of the virtual machine.
Indicates whether this virtual machine uses an SSH key for authentication.
The lab subnet name of the virtual machine.
The lab virtual network identifier of the virtual machine.
Last known compute power state captured in DTL
The network interface properties.
The object identifier of the owner of the virtual machine.
The user principal name of the virtual machine owner.
The provisioning status of the resource.
Virtual Machine schedules to be created
Storage type to use for virtual machine (i.e. Standard, Premium).
The unique immutable identifier of a resource (Guid).
Tells source of creation of lab virtual machine. Output property only.