Skip to content
Matthew Kelly edited this page Jul 30, 2017 · 4 revisions

Overview

The OS section is where you define the OS type, size, offer and SKUs of your virtual machines. You can define the OS in two ways: globally and locally.

In general, the OS section is layed out as follows:

"os": {
    "type": "Windows",
    "size": "Standard_DS1_v2",
    "publisher": "MicrosoftWindowsServer",
    "offer": "WindowsServer",
    "skus": "2016-Datacenter"
}

Properties

Below are the properties that are used when defining an os object - both globally and locally

Name Type Required Description
offer string yes The Offer to use with the Publisher; such as WindowsServer or SQL2016SP1-WS2016
publisher string yes The Publisher of the Offer and SKUs; such as MicorsoftWindowsServer or MicrosoftSQLServer
size string yes The size of the VM; such as Standard_DS1_v2
skus string yes The SKUs to use with the Publisher and Offer; such as 2016-Datacenter or Standard (for SQL Server)
type string yes The type of OS for a VM. Can be either Windows or Linux

Global

Defining the OS within the global "os" property is a quick way of defining the size and type of every VM within the main template. It saves you from having the same OS block multiple times, thus shrinking the size of the template.

The global OS property is inline with the main template, firewall and provisioners properties at the root of the JSON object:

{
    "template": [ ],
    "provisioners": { },
    "os": {
        "type": "Windows",
        "size": "Standard_DS1_v2",
        "publisher": "MicrosoftWindowsServer",
        "offer": "WindowsServer",
        "skus": "2016-Datacenter"
    }
}

Local

Normally it's best practice to define your VM OS types within the global block above, this way it leaves the local OS block within a VM template free to override the global one.

When you define a local OS typing within a VM template, it will override whatever you set the global one to be. So if you global one is for a size of Standard_DS1_v2 (and other properties), but you local one is for a size of Standard_DS4_v2; your VM with be of size Standard_DS4_v2.

The local OS block is within a VM template object:

{
    "template": [
        {
            "tag": "example",
            "type": "vm",
            "os": {
                "type": "Windows",
                "size": "Standard_DS4_v2",
                "publisher": "MicrosoftWindowsServer",
                "offer": "WindowsServer",
                "skus": "2012-Datacenter"
            }
        }
    ]
}

Clone this wiki locally