VirtualHardDiskArgs

data class VirtualHardDiskArgs(val blockSizeBytes: Output<Int>? = null, val containerId: Output<String>? = null, val createFromLocal: Output<Boolean>? = null, val diskFileFormat: Output<Either<String, DiskFileFormat>>? = null, val diskSizeGB: Output<Double>? = null, val downloadUrl: Output<String>? = null, val dynamic: Output<Boolean>? = null, val extendedLocation: Output<ExtendedLocationArgs>? = null, val hyperVGeneration: Output<Either<String, HyperVGeneration>>? = null, val location: Output<String>? = null, val logicalSectorBytes: Output<Int>? = null, val physicalSectorBytes: Output<Int>? = null, val resourceGroupName: Output<String>? = null, val tags: Output<Map<String, String>>? = null, val virtualHardDiskName: Output<String>? = null) : ConvertibleToJava<VirtualHardDiskArgs>

The virtual hard disk resource definition. Uses Azure REST API version 2025-02-01-preview. In version 2.x of the Azure Native provider, it used API version 2022-12-15-preview. Other available API versions: 2022-12-15-preview, 2023-07-01-preview, 2023-09-01-preview, 2024-01-01, 2024-02-01-preview, 2024-05-01-preview, 2024-07-15-preview, 2024-08-01-preview, 2024-10-01-preview, 2025-04-01-preview. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native azurestackhci [ApiVersion]. See the ../../../version-guide/#accessing-any-api-version-via-local-packages for details.

Example Usage

CreateVirtualHardDiskFromLocal

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var virtualHardDisk = new AzureNative.AzureStackHCI.VirtualHardDisk("virtualHardDisk", new()
{
ContainerId = "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-storage-container",
CreateFromLocal = true,
ExtendedLocation = new AzureNative.AzureStackHCI.Inputs.ExtendedLocationArgs
{
Name = "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location",
Type = AzureNative.AzureStackHCI.ExtendedLocationTypes.CustomLocation,
},
Location = "West US2",
ResourceGroupName = "test-rg",
VirtualHardDiskName = "test-vhd",
});
});
package main
import (
azurestackhci "github.com/pulumi/pulumi-azure-native-sdk/azurestackhci/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := azurestackhci.NewVirtualHardDisk(ctx, "virtualHardDisk", &azurestackhci.VirtualHardDiskArgs{
ContainerId: pulumi.String("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-storage-container"),
CreateFromLocal: pulumi.Bool(true),
ExtendedLocation: &azurestackhci.ExtendedLocationArgs{
Name: pulumi.String("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"),
Type: pulumi.String(azurestackhci.ExtendedLocationTypesCustomLocation),
},
Location: pulumi.String("West US2"),
ResourceGroupName: pulumi.String("test-rg"),
VirtualHardDiskName: pulumi.String("test-vhd"),
})
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.azurestackhci.VirtualHardDisk;
import com.pulumi.azurenative.azurestackhci.VirtualHardDiskArgs;
import com.pulumi.azurenative.azurestackhci.inputs.ExtendedLocationArgs;
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 virtualHardDisk = new VirtualHardDisk("virtualHardDisk", VirtualHardDiskArgs.builder()
.containerId("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.AzureStackHCI/storageContainers/test-storage-container")
.createFromLocal(true)
.extendedLocation(ExtendedLocationArgs.builder()
.name("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location")
.type("CustomLocation")
.build())
.location("West US2")
.resourceGroupName("test-rg")
.virtualHardDiskName("test-vhd")
.build());
}
}

PutVirtualHardDisk

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var virtualHardDisk = new AzureNative.AzureStackHCI.VirtualHardDisk("virtualHardDisk", new()
{
DiskSizeGB = 32,
ExtendedLocation = new AzureNative.AzureStackHCI.Inputs.ExtendedLocationArgs
{
Name = "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location",
Type = AzureNative.AzureStackHCI.ExtendedLocationTypes.CustomLocation,
},
Location = "West US2",
ResourceGroupName = "test-rg",
VirtualHardDiskName = "test-vhd",
});
});
package main
import (
azurestackhci "github.com/pulumi/pulumi-azure-native-sdk/azurestackhci/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := azurestackhci.NewVirtualHardDisk(ctx, "virtualHardDisk", &azurestackhci.VirtualHardDiskArgs{
DiskSizeGB: pulumi.Float64(32),
ExtendedLocation: &azurestackhci.ExtendedLocationArgs{
Name: pulumi.String("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"),
Type: pulumi.String(azurestackhci.ExtendedLocationTypesCustomLocation),
},
Location: pulumi.String("West US2"),
ResourceGroupName: pulumi.String("test-rg"),
VirtualHardDiskName: pulumi.String("test-vhd"),
})
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.azurestackhci.VirtualHardDisk;
import com.pulumi.azurenative.azurestackhci.VirtualHardDiskArgs;
import com.pulumi.azurenative.azurestackhci.inputs.ExtendedLocationArgs;
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 virtualHardDisk = new VirtualHardDisk("virtualHardDisk", VirtualHardDiskArgs.builder()
.diskSizeGB(32.0)
.extendedLocation(ExtendedLocationArgs.builder()
.name("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location")
.type("CustomLocation")
.build())
.location("West US2")
.resourceGroupName("test-rg")
.virtualHardDiskName("test-vhd")
.build());
}
}

Import

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

$ pulumi import azure-native:azurestackhci:VirtualHardDisk test-vhd /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualHardDisks/{virtualHardDiskName}

Constructors

Link copied to clipboard
constructor(blockSizeBytes: Output<Int>? = null, containerId: Output<String>? = null, createFromLocal: Output<Boolean>? = null, diskFileFormat: Output<Either<String, DiskFileFormat>>? = null, diskSizeGB: Output<Double>? = null, downloadUrl: Output<String>? = null, dynamic: Output<Boolean>? = null, extendedLocation: Output<ExtendedLocationArgs>? = null, hyperVGeneration: Output<Either<String, HyperVGeneration>>? = null, location: Output<String>? = null, logicalSectorBytes: Output<Int>? = null, physicalSectorBytes: Output<Int>? = null, resourceGroupName: Output<String>? = null, tags: Output<Map<String, String>>? = null, virtualHardDiskName: Output<String>? = null)

Properties

Link copied to clipboard
val blockSizeBytes: Output<Int>? = null

Block size in bytes

Link copied to clipboard
val containerId: Output<String>? = null

Storage ContainerID of the storage container to be used for VHD

Link copied to clipboard
val createFromLocal: Output<Boolean>? = null

Boolean indicating whether it is an existing local hard disk or if one should be created.

Link copied to clipboard
val diskFileFormat: Output<Either<String, DiskFileFormat>>? = null

The format of the actual VHD file vhd, vhdx

Link copied to clipboard
val diskSizeGB: Output<Double>? = null

Size of the disk in GB

Link copied to clipboard
val downloadUrl: Output<String>? = null

URL for downloading or accessing the virtual hard disk. This URL points to a secure link from where the VHD can be downloaded or accessed directly.

Link copied to clipboard
val dynamic: Output<Boolean>? = null

Boolean for enabling dynamic sizing on the virtual hard disk

Link copied to clipboard

The extendedLocation of the resource.

Link copied to clipboard
val hyperVGeneration: Output<Either<String, HyperVGeneration>>? = null

The hypervisor generation of the Virtual Machine V1, V2

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

The geo-location where the resource lives

Link copied to clipboard
val logicalSectorBytes: Output<Int>? = null

Logical sector in bytes

Link copied to clipboard
val physicalSectorBytes: Output<Int>? = null

Physical sector in bytes

Link copied to clipboard
val resourceGroupName: Output<String>? = null

The name of the resource group. The name is case insensitive.

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

Resource tags.

Link copied to clipboard
val virtualHardDiskName: Output<String>? = null

Name of the virtual hard disk

Functions

Link copied to clipboard
open override fun toJava(): VirtualHardDiskArgs