azurerm_virtual_machine

azurerm_virtual_machine

The azurerm_virtual_machine resource enables Cluster to create customized virtual machine groups.

Example Usage

The following is a basic example:

resource:
  azurerm_virtual_machine:
    linux_worker_swarm:
      instance_type: "t2.xlarge"
      os: "Ubuntu 18.04"
      quantity: "1"
      role: "linux_worker"
      swarm_labels:
         com.docker.ucp.orchestrator.kubernetes: "true"
         com.docker.ucp.orchestrator.swarm: "false"

The following is an example of using a custom image:

resource:
  azurerm_virtual_machine
    linux_worker:
      image:
        offer: "UbuntuServer"
        platform: "ubuntu"
        publisher: "Canonical"
        sku: "18.04-LTS"
        version: "latest"

Settings

Setting Type Default Description
data_disk_size String Derived from os Size of the data disk
enable_public_ips Boolean true Enable a public IP address on the virtual machine instances
image Object Derived from os Custom image, see image below
instance_type String “Standard_DS3_v2” Specifies the Azure virtual machine instance type to provision
os String “Ubuntu 18.04”
Alias that is expanded to an image

Make sure the OS you select is compatible with the product you’re installing.

Options:
- “CentOS 7”
- “CentOS 8”
- “Oracle Linux 7.6”
- “RHEL 7.6”
- “RHEL 7.7”
- “RHEL 8.0”
- “RHEL 8.1”
- “SLES 12 SP4”
- “Ubuntu 16.04”
- “Ubuntu 18.04”
- “Windows Server 2016”
- “Windows Server 2016 Core”
- “Windows Server 2019”
- “Windows Server 2019 Core”
os_disk_size String Derived from os Size of the OS disk
quantity String None Number of instances
role String Derived
The instance group’s cluster role
Options:
- “linux_ucp”
- “linux_dtr”
- “linux_worker”
- “windows_worker”
- “windows_worker_ssh”
swarm_labels String Generated Additional key-value pairs of swarm labels to apply to each instance
tags String Object(key-value pair) Additional key-value pairs to assign to each instance
username String
os dependent:
- CentOS = “docker”“
- Oracle Linux = “docker”
- RedHat = “docker”
- SLES = “docker”
- Ubuntu = “ubuntu”
- Windows 2016 = “dockeradmin”
- Windows 2019 = “dockeradmin”
Username for the virtual machine instance’s user with administrative privileges

image

Setting Type Default Description
offer String None Offer of the image
platform String None Platform of the image
publisher String None Publisher of the image
sku String None SKU of the image
version String None Version of the image