Skip to content

ComputeNode

The ComputeNode resource provisions virtual machines. Currently only virtualMachine compute type is supported. When a domain is specified, the VM is automatically joined to Active Directory.

Structure

- type: computeNode
  computeType: virtualMachine
  name: vmweb                         # unique identifier within the RGT
  displayName: Web Server             # optional, human-readable name
  image: win2022                      # OS image
  domain: yourdomain.local            # optional, AD domain to join
  cpu: 4                              # option A: specify CPU + memory
  memory: 16                          #   (integers = GB)
  size: standard_d4s_v5               # option B: specify Azure SKU directly
  alias: ["web-alias"]                # optional, DNS aliases
  providerConfig:                     # optional, provider-specific settings
    azure:
      tempDiskDriveLetter: Z
      availability:
        zone: 1
  disk:                               # optional, additional disks
    - size: 100gb
      volume:
        - mountpoint: D
          label: Data
          fileSystem: NTFS
      providerConfig:                 # optional, provider-specific disk settings
        azure:
          sku: Premium_LRS
  config:                             # optional, configuration tasks
    - name: package
      variables:
        name:
          - nginx

Sizing

There are two ways to size a VM — use one or the other, not both:

Option A: CPU + Memory

cpu: 4
memory: 16
  • cpu — number of vCPUs (integer)
  • memory — RAM amount. Integers are interpreted as GB. Use a string with a unit suffix for other sizes:
  • 16 = 16 GB
  • "16gb" = 16 GB
  • "512mb" = 512 MB
  • "1tb" = 1 TB

Tip

Dune picks a VM size that matches the given cpu/memory. Use the VM_SIZE_FILTER variable to restrict the pool of candidate sizes.

Option B: ResourceProvider specific VM Size

size: standard_d4s_v5

Use a resourceprovider specific size. This takes precedence over cpu/memory if both are specified.

Disks

Additional data disks are defined in the disk array. Each disk has a size and one or more volume definitions. The fields of a volume depend on the guest OS — Windows uses drive letters and NTFS, Linux uses LVM volume groups and logical volumes.

Windows volumes

disk:
  - size: 100gb
    volume:
      - mountpoint: D
        label: SQL_Bin
        fileSystem: NTFS
  - size: 50gb
    volume:
      - mountpoint: E:\User_DB
        label: User_DB
        fileSystem: NTFS
        blocksize: 65536
Volume field Required Description
mountpoint Yes Drive letter (D) or path (E:\User_DB)
label No Volume label. If omitted, no label is set.
fileSystem No File system type. Defaults to NTFS.
blocksize No Allocation unit size in bytes (e.g., 65536 for SQL Server data files)

Linux volumes

Linux disks are provisioned with LVM. Each physical disk is assigned to a volume group, and one or more logical volumes are carved out of it. Multiple volume entries can share the same volumegroup to split a disk into several logical volumes:

disk:
  - size: 64
    volume:
      - volumegroup: rootvg0
        logicalvolume: lv_tmp
        mountpoint: /tmp
        filesystem: xfs
        size: 16
        opts: nodev,nosuid
      - volumegroup: rootvg0
        logicalvolume: lv_home
        mountpoint: /home
        filesystem: xfs
  - size: 1228
    volume:
      - volumegroup: oraclevg0
        logicalvolume: lv_u01
        mountpoint: /u01
        filesystem: xfs
        size: 100
      - volumegroup: oraclevg0
        logicalvolume: lv_u09
        mountpoint: /u09
        filesystem: xfs
Volume field Required Description
volumegroup Yes LVM volume group name
logicalvolume Yes LVM logical volume name
mountpoint Yes Mount path (e.g., /tmp, /u01)
filesystem Yes File system type (e.g., xfs, ext4)
size No Size of this logical volume in GB. Omit on the final volume in a volume group to consume the remaining free space.
opts No Mount options (e.g., nodev,nosuid)

Disk providerConfig.azure

Each entry in disk accepts its own providerConfig for provider-specific disk settings. Disk encryption set and availability zone are inherited from the VM and cannot be set per disk.

disk:
  - size: 500gb
    volume:
      - mountpoint: E
        label: SQL_Data
        fileSystem: NTFS
    providerConfig:
      azure:
        sku: PremiumV2_LRS
        iops: 8000
        mbps: 300
        sectorsize: 4096
Key Required Default Description
sku No Premium_LRS Managed disk SKU, e.g. Premium_LRS, StandardSSD_LRS, PremiumV2_LRS, UltraSSD_LRS. PremiumV2_LRS and UltraSSD_LRS use the performance keys below; all other SKUs use performancetier.
iops No 5000 Provisioned IOPS. PremiumV2_LRS / UltraSSD_LRS only.
mbps No 150 Provisioned throughput in MB/s. PremiumV2_LRS / UltraSSD_LRS only.
sectorsize No Azure default Logical sector size in bytes (512 or 4096). PremiumV2_LRS / UltraSSD_LRS only.
performancetier No size-dependent Performance tier such as P30, lets a small disk run at the throughput of a larger tier. Ignored for PremiumV2_LRS / UltraSSD_LRS.
hostCaching No None Host caching mode: None, ReadOnly or ReadWrite.

Aliases

Aliases create additional DNS entries pointing to the VM:

alias: ["db-alias-0", "db-alias-1"]

Aliases can be referenced in expressions using {{computenode.<name>.alias[0]}} and {{computenode.<name>.alias[1]}}.

providerConfig

The providerConfig block holds settings that only apply to a specific resource provider. Keys the provider does not know are ignored. Values may be template expressions ({{parameters.foo}}).

providerConfig:
  azure:
    availability:
      zone: "{{parameters.availabilityZone}}"
    tempDiskDriveLetter: Y
    tempDiskAllocationUnitSize: 64KB
    tempDiskFileSystem: NTFS
    installSqlVmExtension: true

providerConfig.azure

Key Required Default Description
availability.zone No — Availability zone (1, 2 or 3) for the VM and its data disks. The deployment fails early when the VM size is restricted in that zone.
availability.set No — Name of an existing availability set in the provider resource group. Ignored with a warning when availability.zone is set. The deployment fails when the set does not exist.
tempDiskDriveLetter No Z Drive letter the ephemeral temp disk is mounted on. Must not collide with any mountpoint in disk. See Ephemeral temp disk.
tempDiskAllocationUnitSize No 4KB Allocation unit size of the ephemeral temp disk, e.g. 64KB for SQL Server tempdb.
tempDiskFileSystem No NTFS File system of the ephemeral temp disk (NTFS or ReFS). Only applied to NVMe temp disks, SCSI temp disks are always NTFS.
installSqlVmExtension No false Register the VM with the Azure SQL IaaS Agent extension after deployment. Only useful on VMs where SQL Server is installed.

Ephemeral temp disk (Windows)

Many Azure VM sizes come with an ephemeral temp disk (sizes with a d in the name, e.g. standard_d4ds_v5). Its content is lost on every deallocation, which makes it a good place for the pagefile and SQL Server tempdb. Dune prepares the temp disk on Windows VMs right after the domain join, before data disks are attached:

  • SCSI temp disk (most sizes): Azure delivers the disk pre-formatted as D: with the pagefile on it. Dune moves the pagefile to C:, reformats D: when tempDiskAllocationUnitSize is set, re-letters the volume to tempDiskDriveLetter and moves the pagefile back onto it. This involves two reboots.
  • NVMe temp disk (e.g. standard_d4ads_v6, standard_e4ds_v6): Azure delivers raw NVMe devices that are not formatted. Dune registers a scheduled task that runs at every startup, pools the devices and creates a volume with tempDiskFileSystem, tempDiskAllocationUnitSize and tempDiskDriveLetter. The pagefile stays on C:.

In both cases the volume carries the label Temporary Storage. VM sizes without a temp disk skip this step. Linux VMs are not touched.

Drive letter collisions

The temp disk is re-lettered before data disks are attached, so a data disk volume can use D: afterwards. Make sure tempDiskDriveLetter does not match any mountpoint in disk — e.g. use Y when a data disk is mounted on Z. Otherwise the data disk volume fails to mount.

Config

The config block defines configuration tasks that run on this VM after provisioning. Each task maps to an AWX job template that executes an Ansible playbook against the VM. See Config Tasks for all available tasks.

config:
  - name: package
    variables:
      name:
        - firefox
        - notepadplusplus
  - name: firewall-rule
    variables:
      name: allow-https
      action: allow
      localport: 443
      protocol: tcp
      direction: in

Reference Format

Use {{computenode.<name>.<property>}} to reference a compute node's properties in expressions.

Given a VM with name: vmfoo, VIRTUALMACHINE_HOSTNAME_PREFIX: vm-, VIRTUALMACHINE_HOSTNAME_LENGTH: 8:

Expression Type Example output
{{computenode.vmfoo}} string vm-7a1893cb
{{computenode.vmfoo.name}} string vmfoo
{{computenode.vmfoo.hostname}} string vm-7a1893cb
{{computenode.vmfoo.displayname}} string Foo Server
{{computenode.vmfoo.dnsdomain}} string yourdomain.local
{{computenode.vmfoo.fqdn}} string vm-7a1893cb.yourdomain.local
{{computenode.vmfoo.logicalcpus}} string 4
{{computenode.vmfoo.memorymb}} string 8192
{{computenode.vmfoo.operatingsystem}} string win2022
{{computenode.vmfoo.alias[0]}} string foo-alias-0
{{computenode.vmfoo.alias[1]}} string foo-alias-1

Note

{{computenode.vmfoo}} (without a property) returns the hostname — this is the shorthand for {{computenode.vmfoo.hostname}}.

Modifiers (Variables)

These variables control how compute nodes are provisioned. Set them as Variables at the appropriate level (Tenant, Collection, Deployment).

Variable Type Required Level Default Description
DEFAULT_AD_RESOURCEPROVIDER string Yes Variable — Identifier of the Active Directory resource provider (e.g., ad-foo-bar)
VIRTUALMACHINE_HOSTNAME_PREFIX string No Variable — Prefix for generated hostnames (e.g., vm-)
VM_SIZE_FILTER list No Variable — Restrict available VM SKUs (e.g., "standard_d4s_v5", "standard_e4s_v5")
MONITORING_SOLUTION string No Variable — Monitoring solution identifier

Example

A database server with multiple disks and SQL Server installed:

- type: computeNode
  computeType: virtualMachine
  name: vmdb
  displayName: DB Server
  alias: ["db-alias"]
  image: win2022
  cpu: 4
  memory: 8gb
  domain: yourdomain.local
  providerConfig:
    azure:
      tempDiskDriveLetter: T
      tempDiskAllocationUnitSize: 64KB
      installSqlVmExtension: true
  disk:
    - size: 20gb
      volume:
        - mountpoint: D
          label: SQL_Bin
          fileSystem: NTFS
    - size: 5gb
      volume:
        - mountpoint: E
          label: SQL_Data
          fileSystem: NTFS
          blocksize: 65536
      providerConfig:
        azure:
          sku: PremiumV2_LRS
          iops: 6000
          mbps: 250
          sectorsize: 4096
    - size: 1tb
      volume:
        - mountpoint: E:\User_Data
          label: User_Data
          fileSystem: NTFS
          blocksize: 65536
  config:
    - name: install-sql
      variables:
        mssql_version: sql22dev
        mssql_collation: Latin1_General_CI_AS
        mssql_features: SQLENGINE,FULLTEXT
        mssql_sysadmin_accounts: ["yourdomain\\grp-sysadmin"]

Next: ServiceAccount