Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for ephemeral disk placement #3948

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,11 @@ runs:
- name: Azure Login
uses: azure/login@v2
with:
client-id: ${{ env.AZURE_CLIENT_ID }}
Kittoes0124 marked this conversation as resolved.
Show resolved Hide resolved
creds: ${{ env.AZURE_CREDENTIALS }}
enable-AzPSSession: true
subscription-id: ${{ env.AZURE_SUBSCRIPTION_ID }}
tenant-id: ${{ env.AZURE_TENANT_ID }}

# [Set Deployment Location] task(s)
# ---------------------------
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/avm.template.module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,10 @@ jobs:
removeDeployment: "${{ fromJson(inputs.workflowInput).removeDeployment }}"
customLocation: "${{ fromJson(inputs.workflowInput).customLocation }}"
env:
AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
Kittoes0124 marked this conversation as resolved.
Show resolved Hide resolved
AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }}
AZURE_SUBSCRIPTION_ID: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}

##################
# Publishing #
Expand Down
81 changes: 69 additions & 12 deletions avm/res/compute/virtual-machine/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This module deploys a Virtual Machine with one or multiple NICs and optionally o
| :-- | :-- |
| `Microsoft.Authorization/locks` | [2020-05-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2020-05-01/locks) |
| `Microsoft.Authorization/roleAssignments` | [2022-04-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2022-04-01/roleAssignments) |
| `Microsoft.Automanage/configurationProfileAssignments` | [2022-05-04](https://learn.microsoft.com/en-us/azure/templates) |
| `Microsoft.Automanage/configurationProfileAssignments` | [2022-05-04](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Automanage/2022-05-04/configurationProfileAssignments) |
| `Microsoft.Compute/disks` | [2024-03-02](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Compute/2024-03-02/disks) |
| `Microsoft.Compute/virtualMachines` | [2024-07-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Compute/2024-07-01/virtualMachines) |
| `Microsoft.Compute/virtualMachines/extensions` | [2022-11-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Compute/2022-11-01/virtualMachines/extensions) |
Expand Down Expand Up @@ -4775,10 +4775,10 @@ param virtualMachineScaleSetResourceId = '<virtualMachineScaleSetResourceId>'
| [`dedicatedHostId`](#parameter-dedicatedhostid) | string | Specifies resource ID about the dedicated host that the virtual machine resides in. |
| [`disablePasswordAuthentication`](#parameter-disablepasswordauthentication) | bool | Specifies whether password authentication should be disabled. |
| [`enableAutomaticUpdates`](#parameter-enableautomaticupdates) | bool | Indicates whether Automatic Updates is enabled for the Windows virtual machine. Default value is true. When patchMode is set to Manual, this parameter must be set to false. For virtual machine scale sets, this property can be updated and updates will take effect on OS reprovisioning. |
| [`enableEvictionPolicy`](#parameter-enableevictionpolicy) | bool | Specifies the eviction policy for the low priority virtual machine. Will result in 'Deallocate' eviction policy. |
| [`enableHotpatching`](#parameter-enablehotpatching) | bool | Enables customers to patch their Azure VMs without requiring a reboot. For enableHotpatching, the 'provisionVMAgent' must be set to true and 'patchMode' must be set to 'AutomaticByPlatform'. |
| [`enableTelemetry`](#parameter-enabletelemetry) | bool | Enable/Disable usage telemetry for module. |
| [`encryptionAtHost`](#parameter-encryptionathost) | bool | This property can be used by user in the request to enable or disable the Host Encryption for the virtual machine. This will enable the encryption for all the disks including Resource/Temp disk at host itself. For security reasons, it is recommended to set encryptionAtHost to True. Restrictions: Cannot be enabled if Azure Disk Encryption (guest-VM encryption using bitlocker/DM-Crypt) is enabled on your VMs. |
| [`evictionPolicy`](#parameter-evictionpolicy) | string | Specifies the eviction policy for the low priority virtual machine. |
| [`extensionAadJoinConfig`](#parameter-extensionaadjoinconfig) | object | The configuration for the [AAD Join] extension. Must at least contain the ["enabled": true] property to be executed. To enroll in Intune, add the setting mdmId: "0000000a-0000-0000-c000-000000000000". |
| [`extensionAntiMalwareConfig`](#parameter-extensionantimalwareconfig) | object | The configuration for the [Anti Malware] extension. Must at least contain the ["enabled": true] property to be executed. |
| [`extensionAzureDiskEncryptionConfig`](#parameter-extensionazurediskencryptionconfig) | object | The configuration for the [Azure Disk Encryption] extension. Must at least contain the ["enabled": true] property to be executed. Restrictions: Cannot be enabled on disks that have encryption at host enabled. Managed disks encrypted using Azure Disk Encryption cannot be encrypted using customer-managed keys. |
Expand Down Expand Up @@ -4876,6 +4876,7 @@ Specifies the OS disk. For security reasons, it is recommended to specify DiskEn
| [`caching`](#parameter-osdiskcaching) | string | Specifies the caching requirements. |
| [`createOption`](#parameter-osdiskcreateoption) | string | Specifies how the virtual machine should be created. |
| [`deleteOption`](#parameter-osdiskdeleteoption) | string | Specifies whether data disk should be deleted or detached upon VM deletion. |
| [`diffDiskSettings`](#parameter-osdiskdiffdisksettings) | object | Specifies the ephemeral Disk Settings for the operating system disk. |
| [`diskSizeGB`](#parameter-osdiskdisksizegb) | int | Specifies the size of an empty data disk in gigabytes. |
| [`name`](#parameter-osdiskname) | string | The disk name. |

Expand Down Expand Up @@ -4963,6 +4964,34 @@ Specifies whether data disk should be deleted or detached upon VM deletion.
]
```

### Parameter: `osDisk.diffDiskSettings`

Specifies the ephemeral Disk Settings for the operating system disk.

- Required: No
- Type: object

**Required parameters**

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`placement`](#parameter-osdiskdiffdisksettingsplacement) | string | Specifies the ephemeral disk placement for the operating system disk. |

### Parameter: `osDisk.diffDiskSettings.placement`

Specifies the ephemeral disk placement for the operating system disk.

- Required: Yes
- Type: string
- Allowed:
```Bicep
[
'CacheDisk'
'NvmeDisk'
'ResourceDisk'
]
```

### Parameter: `osDisk.diskSizeGB`

Specifies the size of an empty data disk in gigabytes.
Expand Down Expand Up @@ -5324,14 +5353,6 @@ Indicates whether Automatic Updates is enabled for the Windows virtual machine.
- Type: bool
- Default: `True`

### Parameter: `enableEvictionPolicy`

Specifies the eviction policy for the low priority virtual machine. Will result in 'Deallocate' eviction policy.

- Required: No
- Type: bool
- Default: `False`

### Parameter: `enableHotpatching`

Enables customers to patch their Azure VMs without requiring a reboot. For enableHotpatching, the 'provisionVMAgent' must be set to true and 'patchMode' must be set to 'AutomaticByPlatform'.
Expand All @@ -5356,6 +5377,21 @@ This property can be used by user in the request to enable or disable the Host E
- Type: bool
- Default: `True`

### Parameter: `evictionPolicy`

Specifies the eviction policy for the low priority virtual machine.

- Required: No
- Type: string
- Default: `'Deallocate'`
- Allowed:
```Bicep
[
'Deallocate'
'Delete'
]
```

### Parameter: `extensionAadJoinConfig`

The configuration for the [AAD Join] extension. Must at least contain the ["enabled": true] property to be executed. To enroll in Intune, add the setting mdmId: "0000000a-0000-0000-c000-000000000000".
Expand Down Expand Up @@ -5631,7 +5667,7 @@ The managed identity definition for this resource. The system-assigned managed i
| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`systemAssigned`](#parameter-managedidentitiessystemassigned) | bool | Enables system assigned managed identity on the resource. |
| [`userAssignedResourceIds`](#parameter-managedidentitiesuserassignedresourceids) | array | The resource ID(s) to assign to the resource. |
| [`userAssignedResourceIds`](#parameter-managedidentitiesuserassignedresourceids) | array | The resource ID(s) to assign to the resource. Required if a user assigned identity is used for encryption. |

### Parameter: `managedIdentities.systemAssigned`

Expand All @@ -5642,7 +5678,7 @@ Enables system assigned managed identity on the resource.

### Parameter: `managedIdentities.userAssignedResourceIds`

The resource ID(s) to assign to the resource.
The resource ID(s) to assign to the resource. Required if a user assigned identity is used for encryption.

- Required: No
- Type: array
Expand Down Expand Up @@ -5736,6 +5772,27 @@ The list of SSH public keys used to authenticate with linux based VMs.
- Type: array
- Default: `[]`

**Required parameters**

| Parameter | Type | Description |
| :-- | :-- | :-- |
| [`keyData`](#parameter-publickeyskeydata) | string | Specifies the SSH public key data used to authenticate through ssh. |
| [`path`](#parameter-publickeyspath) | string | Specifies the full path on the created VM where ssh public key is stored. If the file already exists, the specified key is appended to the file. |

### Parameter: `publicKeys.keyData`

Specifies the SSH public key data used to authenticate through ssh.

- Required: Yes
- Type: string

### Parameter: `publicKeys.path`

Specifies the full path on the created VM where ssh public key is stored. If the file already exists, the specified key is appended to the file.

- Required: Yes
- Type: string

### Parameter: `rebootSetting`

Specifies the reboot setting for all AutomaticByPlatform patch installation operations.
Expand Down
9 changes: 3 additions & 6 deletions avm/res/compute/virtual-machine/extension/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.31.92.45157",
"templateHash": "688718350646227538"
"version": "0.32.4.45862",
"templateHash": "12912200857967286939"
},
"name": "Virtual Machine Extensions",
"description": "This module deploys a Virtual Machine Extension.",
Expand Down Expand Up @@ -121,10 +121,7 @@
"settings": "[if(not(empty(parameters('settings'))), parameters('settings'), null())]",
"protectedSettings": "[if(not(empty(parameters('protectedSettings'))), parameters('protectedSettings'), null())]",
"suppressFailures": "[parameters('supressFailures')]"
},
"dependsOn": [
"virtualMachine"
]
}
}
},
"outputs": {
Expand Down
Loading
Loading