From 9ef093976b9260ad953348267afeb8f8a29b65e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Gardfj=C3=A4ll?= Date: Sun, 30 Oct 2022 11:35:44 +0100 Subject: [PATCH] Make Azure OS disk type configurable and default to a cheaper type (#14533) * add azure option for osDiskType * azure: change default image to minimal ubuntu --- config.cfg | 9 +++++++-- roles/cloud-azure/files/deployment.json | 8 +++++++- roles/cloud-azure/tasks/main.yml | 2 ++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/config.cfg b/config.cfg index 95e98a4..b76aa7f 100644 --- a/config.cfg +++ b/config.cfg @@ -165,10 +165,15 @@ SSH_keys: cloud_providers: azure: size: Standard_B1S + osDisk: + # The storage account type to use for the OS disk. Possible values: + # 'Standard_LRS', 'Premium_LRS', 'StandardSSD_LRS', 'UltraSSD_LRS', + # 'Premium_ZRS', 'StandardSSD_ZRS', 'PremiumV2_LRS'. + type: Standard_LRS image: publisher: Canonical - offer: 0001-com-ubuntu-server-focal-daily - sku: 20_04-daily-lts + offer: 0001-com-ubuntu-minimal-focal-daily + sku: minimal-20_04-daily-lts version: latest digitalocean: size: s-1vcpu-1gb diff --git a/roles/cloud-azure/files/deployment.json b/roles/cloud-azure/files/deployment.json index bfc1d6f..f488906 100644 --- a/roles/cloud-azure/files/deployment.json +++ b/roles/cloud-azure/files/deployment.json @@ -23,6 +23,9 @@ "imageReferenceVersion": { "type": "string" }, + "osDiskType": { + "type": "string" + }, "SshPort": { "type": "int" }, @@ -197,7 +200,10 @@ "version": "[parameters('imageReferenceVersion')]" }, "osDisk": { - "createOption": "FromImage" + "createOption": "FromImage", + "managedDisk": { + "storageAccountType": "[parameters('osDiskType')]" + } } }, "networkProfile": { diff --git a/roles/cloud-azure/tasks/main.yml b/roles/cloud-azure/tasks/main.yml index 2761544..dafbe0d 100644 --- a/roles/cloud-azure/tasks/main.yml +++ b/roles/cloud-azure/tasks/main.yml @@ -37,6 +37,8 @@ value: "{{ cloud_providers.azure.image.sku }}" imageReferenceVersion: value: "{{ cloud_providers.azure.image.version }}" + osDiskType: + value: "{{ cloud_providers.azure.osDisk.type }}" SshPort: value: "{{ ssh_port }}" UserData: