VirtualMachine

class VirtualMachine : KotlinCustomResource

The VirtualMachines resource definition. Uses Azure REST API version 2023-04-01-preview. In version 2.x of the Azure Native provider, it used API version 2022-05-21-preview. Other available API versions: 2022-05-21-preview. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native scvmm [ApiVersion]. See the ../../../version-guide/#accessing-any-api-version-via-local-packages for details.

Example Usage

CreateVirtualMachine

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var virtualMachine = new AzureNative.ScVmm.VirtualMachine("virtualMachine", new()
{
CloudId = "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/Clouds/HRCloud",
ExtendedLocation = new AzureNative.ScVmm.Inputs.ExtendedLocationArgs
{
Name = "/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso",
Type = "customLocation",
},
HardwareProfile = new AzureNative.ScVmm.Inputs.HardwareProfileArgs
{
CpuCount = 4,
MemoryMB = 4096,
},
Location = "East US",
ResourceGroupName = "testrg",
TemplateId = "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VirtualMachineTemplates/HRVirtualMachineTemplate",
VirtualMachineName = "DemoVM",
VmmServerId = "/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer",
});
});
package main
import (
scvmm "github.com/pulumi/pulumi-azure-native-sdk/scvmm/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := scvmm.NewVirtualMachine(ctx, "virtualMachine", &scvmm.VirtualMachineArgs{
CloudId: pulumi.String("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/Clouds/HRCloud"),
ExtendedLocation: &scvmm.ExtendedLocationArgs{
Name: pulumi.String("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso"),
Type: pulumi.String("customLocation"),
},
HardwareProfile: &scvmm.HardwareProfileArgs{
CpuCount: pulumi.Int(4),
MemoryMB: pulumi.Int(4096),
},
Location: pulumi.String("East US"),
ResourceGroupName: pulumi.String("testrg"),
TemplateId: pulumi.String("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VirtualMachineTemplates/HRVirtualMachineTemplate"),
VirtualMachineName: pulumi.String("DemoVM"),
VmmServerId: pulumi.String("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer"),
})
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.scvmm.VirtualMachine;
import com.pulumi.azurenative.scvmm.VirtualMachineArgs;
import com.pulumi.azurenative.scvmm.inputs.ExtendedLocationArgs;
import com.pulumi.azurenative.scvmm.inputs.HardwareProfileArgs;
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()
.cloudId("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/Clouds/HRCloud")
.extendedLocation(ExtendedLocationArgs.builder()
.name("/subscriptions/a5015e1c-867f-4533-8541-85cd470d0cfb/resourceGroups/demoRG/providers/Microsoft.Arc/customLocations/contoso")
.type("customLocation")
.build())
.hardwareProfile(HardwareProfileArgs.builder()
.cpuCount(4)
.memoryMB(4096)
.build())
.location("East US")
.resourceGroupName("testrg")
.templateId("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VirtualMachineTemplates/HRVirtualMachineTemplate")
.virtualMachineName("DemoVM")
.vmmServerId("/subscriptions/fd3c3665-1729-4b7b-9a38-238e83b0f98b/resourceGroups/testrg/providers/Microsoft.SCVMM/VMMServers/ContosoVMMServer")
.build());
}
}

Import

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

$ pulumi import azure-native:scvmm:VirtualMachine DemoVM /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ScVmm/virtualMachines/{virtualMachineName}

Properties

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

The Azure API version of the resource.

Link copied to clipboard

Checkpoints in the vm.

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

Type of checkpoint supported for the vm.

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

ARM Id of the cloud resource to use for deploying the vm.

Link copied to clipboard

The extended location.

Link copied to clipboard
val generation: Output<Int>?

Gets or sets the generation for the vm.

Link copied to clipboard

Guest agent status properties.

Link copied to clipboard

Hardware properties.

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

The identity of the resource.

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

Gets or sets the inventory Item ID for the resource.

Link copied to clipboard

Last restored checkpoint in the vm.

Link copied to clipboard
val location: Output<String>

Gets or sets the location.

Link copied to clipboard
val name: Output<String>

Resource Name

Link copied to clipboard

Network properties.

Link copied to clipboard

OS properties.

Link copied to clipboard
val powerState: Output<String>

Gets the power state of the virtual machine.

Link copied to clipboard

Gets or sets the provisioning state.

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

Storage properties.

Link copied to clipboard

The system data.

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

Resource tags

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

ARM Id of the template resource to use for deploying the vm.

Link copied to clipboard
val type: Output<String>

Resource Type

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

Unique ID of the virtual machine.

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

ARM Id of the vmmServer resource in which this resource resides.

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

VMName is the name of VM on the SCVMM server.