diff --git a/avm/res/compute/gallery/README.md b/avm/res/compute/gallery/README.md index d6a31db48f..9427470e22 100644 --- a/avm/res/compute/gallery/README.md +++ b/avm/res/compute/gallery/README.md @@ -9,6 +9,7 @@ This module deploys an Azure Compute Gallery (formerly known as Shared Image Gal - [Parameters](#Parameters) - [Outputs](#Outputs) - [Cross-referenced modules](#Cross-referenced-modules) +- [Notes](#Notes) - [Data Collection](#Data-Collection) ## Resource Types @@ -17,9 +18,9 @@ This module deploys an Azure Compute Gallery (formerly known as Shared Image Gal | :-- | :-- | | `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.Compute/galleries` | [2023-07-03](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Compute/2023-07-03/galleries) | -| `Microsoft.Compute/galleries/applications` | [2022-03-03](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Compute/2022-03-03/galleries/applications) | -| `Microsoft.Compute/galleries/images` | [2023-07-03](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Compute/2023-07-03/galleries/images) | +| `Microsoft.Compute/galleries` | [2024-03-03](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Compute/2024-03-03/galleries) | +| `Microsoft.Compute/galleries/applications` | [2024-03-03](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Compute/2024-03-03/galleries/applications) | +| `Microsoft.Compute/galleries/images` | [2024-03-03](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Compute/2024-03-03/galleries/images) | ## Usage examples @@ -144,6 +145,7 @@ module gallery 'br/public:avm/res/compute/gallery:' = { description: 'This is a test deployment.' images: [ { + allowUpdateImage: true architecture: 'x64' description: 'testDescription' endOfLife: '2033-01-01' @@ -169,6 +171,7 @@ module gallery 'br/public:avm/res/compute/gallery:' = { releaseNoteUri: 'https://testReleaseNoteUri.com' } { + allowUpdateImage: false hyperVGeneration: 'V2' identifier: { offer: 'WindowsServer' @@ -215,6 +218,7 @@ module gallery 'br/public:avm/res/compute/gallery:' = { } } { + diskControllerType: 'SCSI' hyperVGeneration: 'V2' identifier: { offer: '0001-com-ubuntu-minimal-focal' @@ -235,6 +239,7 @@ module gallery 'br/public:avm/res/compute/gallery:' = { } } { + diskControllerType: 'SCSI, NVMe' hyperVGeneration: 'V2' identifier: { offer: '0001-com-ubuntu-minimal-focal' @@ -377,6 +382,7 @@ module gallery 'br/public:avm/res/compute/gallery:' = { "images": { "value": [ { + "allowUpdateImage": true, "architecture": "x64", "description": "testDescription", "endOfLife": "2033-01-01", @@ -402,6 +408,7 @@ module gallery 'br/public:avm/res/compute/gallery:' = { "releaseNoteUri": "https://testReleaseNoteUri.com" }, { + "allowUpdateImage": false, "hyperVGeneration": "V2", "identifier": { "offer": "WindowsServer", @@ -448,6 +455,7 @@ module gallery 'br/public:avm/res/compute/gallery:' = { } }, { + "diskControllerType": "SCSI", "hyperVGeneration": "V2", "identifier": { "offer": "0001-com-ubuntu-minimal-focal", @@ -468,6 +476,7 @@ module gallery 'br/public:avm/res/compute/gallery:' = { } }, { + "diskControllerType": "SCSI, NVMe", "hyperVGeneration": "V2", "identifier": { "offer": "0001-com-ubuntu-minimal-focal", @@ -610,6 +619,7 @@ param applications = [ param description = 'This is a test deployment.' param images = [ { + allowUpdateImage: true architecture: 'x64' description: 'testDescription' endOfLife: '2033-01-01' @@ -635,6 +645,7 @@ param images = [ releaseNoteUri: 'https://testReleaseNoteUri.com' } { + allowUpdateImage: false hyperVGeneration: 'V2' identifier: { offer: 'WindowsServer' @@ -681,6 +692,7 @@ param images = [ } } { + diskControllerType: 'SCSI' hyperVGeneration: 'V2' identifier: { offer: '0001-com-ubuntu-minimal-focal' @@ -701,6 +713,7 @@ param images = [ } } { + diskControllerType: 'SCSI, NVMe' hyperVGeneration: 'V2' identifier: { offer: '0001-com-ubuntu-minimal-focal' @@ -1296,8 +1309,10 @@ Images to create. | Parameter | Type | Description | | :-- | :-- | :-- | +| [`allowUpdateImage`](#parameter-imagesallowupdateimage) | bool | Must be set to true if the gallery image features are being updated. | | [`architecture`](#parameter-imagesarchitecture) | string | The architecture of the image. Applicable to OS disks only. | | [`description`](#parameter-imagesdescription) | string | The description of this gallery image definition resource. This property is updatable. | +| [`diskControllerType`](#parameter-imagesdiskcontrollertype) | string | The disk controllers that an OS disk supports. | | [`endOfLife`](#parameter-imagesendoflife) | string | The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property is updatable. | | [`eula`](#parameter-imageseula) | string | The Eula agreement for the gallery image definition. | | [`excludedDiskTypes`](#parameter-imagesexcludeddisktypes) | array | Describes the disallowed disk types. | @@ -1382,6 +1397,13 @@ This property allows you to specify the type of the OS that is included in the d ] ``` +### Parameter: `images.allowUpdateImage` + +Must be set to true if the gallery image features are being updated. + +- Required: No +- Type: bool + ### Parameter: `images.architecture` The architecture of the image. Applicable to OS disks only. @@ -1403,6 +1425,21 @@ The description of this gallery image definition resource. This property is upda - Required: No - Type: string +### Parameter: `images.diskControllerType` + +The disk controllers that an OS disk supports. + +- Required: No +- Type: string +- Allowed: + ```Bicep + [ + 'NVMe, SCSI' + 'SCSI' + 'SCSI, NVMe' + ] + ``` + ### Parameter: `images.endOfLife` The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property is updatable. @@ -1772,6 +1809,22 @@ This section gives you an overview of all local-referenced module files (i.e., o | :-- | :-- | | `br/public:avm/utl/types/avm-common-types:0.3.0` | Remote reference | +## Notes + +Currently it is not possible to redeploy the `image.diskControllerType` property with a value of `NVMe, SCSI`. The initial deployment is working, but other deployments will result in an error. + +```json +"details": [ + { + "code": "PropertyChangeNotAllowed", + "target": "DiskControllerTypes", + "message": "Changing property 'DiskControllerTypes' is not allowed." + } + ] +``` + +Once this bug has been resolved, the max test will be updated to deploy an image with the property value. + ## Data Collection The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the [repository](https://aka.ms/avm/telemetry). There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft’s privacy statement. Our privacy statement is located at . You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices. diff --git a/avm/res/compute/gallery/application/README.md b/avm/res/compute/gallery/application/README.md index 9400c80cf4..80c590cb8a 100644 --- a/avm/res/compute/gallery/application/README.md +++ b/avm/res/compute/gallery/application/README.md @@ -15,7 +15,7 @@ This module deploys an Azure Compute Gallery Application. | Resource Type | API Version | | :-- | :-- | | `Microsoft.Authorization/roleAssignments` | [2022-04-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2022-04-01/roleAssignments) | -| `Microsoft.Compute/galleries/applications` | [2022-03-03](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Compute/2022-03-03/galleries/applications) | +| `Microsoft.Compute/galleries/applications` | [2024-03-03](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Compute/2024-03-03/galleries/applications) | ## Parameters diff --git a/avm/res/compute/gallery/application/main.bicep b/avm/res/compute/gallery/application/main.bicep index 65a1418585..b8cddc8517 100644 --- a/avm/res/compute/gallery/application/main.bicep +++ b/avm/res/compute/gallery/application/main.bicep @@ -72,11 +72,11 @@ var formattedRoleAssignments = [ }) ] -resource gallery 'Microsoft.Compute/galleries@2022-03-03' existing = { +resource gallery 'Microsoft.Compute/galleries@2024-03-03' existing = { name: galleryName } -resource application 'Microsoft.Compute/galleries/applications@2022-03-03' = { +resource application 'Microsoft.Compute/galleries/applications@2024-03-03' = { name: name parent: gallery location: location diff --git a/avm/res/compute/gallery/application/main.json b/avm/res/compute/gallery/application/main.json index ca08bbc5b4..389026f8c7 100644 --- a/avm/res/compute/gallery/application/main.json +++ b/avm/res/compute/gallery/application/main.json @@ -5,8 +5,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.32.4.45862", - "templateHash": "7761447372947910331" + "version": "0.33.93.31351", + "templateHash": "8421640590183520512" }, "name": "Compute Galleries Applications", "description": "This module deploys an Azure Compute Gallery Application." @@ -281,12 +281,12 @@ "gallery": { "existing": true, "type": "Microsoft.Compute/galleries", - "apiVersion": "2022-03-03", + "apiVersion": "2024-03-03", "name": "[parameters('galleryName')]" }, "application": { "type": "Microsoft.Compute/galleries/applications", - "apiVersion": "2022-03-03", + "apiVersion": "2024-03-03", "name": "[format('{0}/{1}', parameters('galleryName'), parameters('name'))]", "location": "[parameters('location')]", "tags": "[parameters('tags')]", @@ -350,7 +350,7 @@ "metadata": { "description": "The location the resource was deployed into." }, - "value": "[reference('application', '2022-03-03', 'full').location]" + "value": "[reference('application', '2024-03-03', 'full').location]" } } } \ No newline at end of file diff --git a/avm/res/compute/gallery/image/README.md b/avm/res/compute/gallery/image/README.md index 0dbff55826..a5cf55dbb0 100644 --- a/avm/res/compute/gallery/image/README.md +++ b/avm/res/compute/gallery/image/README.md @@ -13,7 +13,7 @@ This module deploys an Azure Compute Gallery Image Definition. | Resource Type | API Version | | :-- | :-- | | `Microsoft.Authorization/roleAssignments` | [2022-04-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2022-04-01/roleAssignments) | -| `Microsoft.Compute/galleries/images` | [2023-07-03](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Compute/2023-07-03/galleries/images) | +| `Microsoft.Compute/galleries/images` | [2024-03-03](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Compute/2024-03-03/galleries/images) | ## Parameters @@ -36,9 +36,11 @@ This module deploys an Azure Compute Gallery Image Definition. | Parameter | Type | Description | | :-- | :-- | :-- | +| [`allowUpdateImage`](#parameter-allowupdateimage) | bool | Must be set to true if the gallery image features are being updated. | | [`architecture`](#parameter-architecture) | string | The architecture of the image. Applicable to OS disks only. | | [`description`](#parameter-description) | string | The description of this gallery image definition resource. This property is updatable. | | [`disallowed`](#parameter-disallowed) | object | Describes the disallowed disk types. | +| [`diskControllerType`](#parameter-diskcontrollertype) | string | The disk controllers that an OS disk supports. | | [`endOfLifeDate`](#parameter-endoflifedate) | string | The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property is updatable. | | [`eula`](#parameter-eula) | string | The Eula agreement for the gallery image definition. | | [`hyperVGeneration`](#parameter-hypervgeneration) | string | The hypervisor generation of the Virtual Machine. If this value is not specified, then it is determined by the securityType parameter. If the securityType parameter is specified, then the value of hyperVGeneration will be V2, else V1. | @@ -132,6 +134,13 @@ The name of the parent Azure Shared Image Gallery. Required if the template is u - Required: Yes - Type: string +### Parameter: `allowUpdateImage` + +Must be set to true if the gallery image features are being updated. + +- Required: No +- Type: bool + ### Parameter: `architecture` The architecture of the image. Applicable to OS disks only. @@ -179,6 +188,21 @@ A list of disk types. ] ``` +### Parameter: `diskControllerType` + +The disk controllers that an OS disk supports. + +- Required: No +- Type: string +- Allowed: + ```Bicep + [ + 'NVMe, SCSI' + 'SCSI' + 'SCSI, NVMe' + ] + ``` + ### Parameter: `endOfLifeDate` The end of life date of the gallery image definition. This property can be used for decommissioning purposes. This property is updatable. @@ -213,7 +237,6 @@ Specify if the image supports accelerated networking. - Required: No - Type: bool -- Default: `True` ### Parameter: `isHibernateSupported` diff --git a/avm/res/compute/gallery/image/main.bicep b/avm/res/compute/gallery/image/main.bicep index c09179fbd7..ae277e2cf0 100644 --- a/avm/res/compute/gallery/image/main.bicep +++ b/avm/res/compute/gallery/image/main.bicep @@ -47,11 +47,14 @@ param securityType ( | 'ConfidentialVMSupported')? @sys.description('Optional. Specify if the image supports accelerated networking.') -param isAcceleratedNetworkSupported bool = true +param isAcceleratedNetworkSupported bool? @sys.description('Optional. Specifiy if the image supports hibernation.') param isHibernateSupported bool? +@sys.description('Optional. Must be set to true if the gallery image features are being updated.') +param allowUpdateImage bool? + @sys.description('Optional. The architecture of the image. Applicable to OS disks only.') param architecture ('x64' | 'Arm64')? @@ -70,6 +73,9 @@ param eula string? @sys.description('Optional. The hypervisor generation of the Virtual Machine. If this value is not specified, then it is determined by the securityType parameter. If the securityType parameter is specified, then the value of hyperVGeneration will be V2, else V1.') param hyperVGeneration ('V1' | 'V2')? +@sys.description('Optional. The disk controllers that an OS disk supports.') +param diskControllerType ('SCSI' | 'SCSI, NVMe' | 'NVMe, SCSI')? + @sys.description('Optional. Array of role assignments to create.') param roleAssignments roleAssignmentType @@ -113,16 +119,17 @@ var formattedRoleAssignments = [ }) ] -resource gallery 'Microsoft.Compute/galleries@2023-07-03' existing = { +resource gallery 'Microsoft.Compute/galleries@2024-03-03' existing = { name: galleryName } -resource image 'Microsoft.Compute/galleries/images@2023-07-03' = { +resource image 'Microsoft.Compute/galleries/images@2024-03-03' = { name: name parent: gallery location: location tags: tags properties: { + allowUpdateImage: allowUpdateImage != null ? allowUpdateImage : null architecture: architecture description: description disallowed: { @@ -131,12 +138,14 @@ resource image 'Microsoft.Compute/galleries/images@2023-07-03' = { endOfLifeDate: endOfLifeDate eula: eula features: union( - [ - { - name: 'IsAcceleratedNetworkSupported' - value: '${isAcceleratedNetworkSupported}' - } - ], + (isAcceleratedNetworkSupported != null // Accelerated network is not set by default and must not be set for unsupported skus + ? [ + { + name: 'IsAcceleratedNetworkSupported' + value: '${isAcceleratedNetworkSupported}' + } + ] + : []), (securityType != null && securityType != 'Standard' // Standard is the default and is not set ? [ { @@ -152,6 +161,14 @@ resource image 'Microsoft.Compute/galleries/images@2023-07-03' = { value: '${isHibernateSupported}' } ] + : []), + (diskControllerType != null + ? [ + { + name: 'DiskControllerTypes' + value: '${diskControllerType}' + } + ] : []) ) hyperVGeneration: hyperVGeneration ?? (!empty(securityType ?? '') ? 'V2' : 'V1') diff --git a/avm/res/compute/gallery/image/main.json b/avm/res/compute/gallery/image/main.json index 62d581baa5..647150763c 100644 --- a/avm/res/compute/gallery/image/main.json +++ b/avm/res/compute/gallery/image/main.json @@ -5,8 +5,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.32.4.45862", - "templateHash": "13858460997059168010" + "version": "0.33.93.31351", + "templateHash": "5191633407919649272" }, "name": "Compute Galleries Image Definitions", "description": "This module deploys an Azure Compute Gallery Image Definition." @@ -285,7 +285,7 @@ }, "isAcceleratedNetworkSupported": { "type": "bool", - "defaultValue": true, + "nullable": true, "metadata": { "description": "Optional. Specify if the image supports accelerated networking." } @@ -297,6 +297,13 @@ "description": "Optional. Specifiy if the image supports hibernation." } }, + "allowUpdateImage": { + "type": "bool", + "nullable": true, + "metadata": { + "description": "Optional. Must be set to true if the gallery image features are being updated." + } + }, "architecture": { "type": "string", "allowedValues": [ @@ -347,6 +354,18 @@ "description": "Optional. The hypervisor generation of the Virtual Machine. If this value is not specified, then it is determined by the securityType parameter. If the securityType parameter is specified, then the value of hyperVGeneration will be V2, else V1." } }, + "diskControllerType": { + "type": "string", + "allowedValues": [ + "NVMe, SCSI", + "SCSI", + "SCSI, NVMe" + ], + "nullable": true, + "metadata": { + "description": "Optional. The disk controllers that an OS disk supports." + } + }, "roleAssignments": { "$ref": "#/definitions/roleAssignmentType", "metadata": { @@ -383,16 +402,17 @@ "gallery": { "existing": true, "type": "Microsoft.Compute/galleries", - "apiVersion": "2023-07-03", + "apiVersion": "2024-03-03", "name": "[parameters('galleryName')]" }, "image": { "type": "Microsoft.Compute/galleries/images", - "apiVersion": "2023-07-03", + "apiVersion": "2024-03-03", "name": "[format('{0}/{1}', parameters('galleryName'), parameters('name'))]", "location": "[parameters('location')]", "tags": "[parameters('tags')]", "properties": { + "allowUpdateImage": "[if(not(equals(parameters('allowUpdateImage'), null())), parameters('allowUpdateImage'), null())]", "architecture": "[parameters('architecture')]", "description": "[parameters('description')]", "disallowed": { @@ -400,7 +420,7 @@ }, "endOfLifeDate": "[parameters('endOfLifeDate')]", "eula": "[parameters('eula')]", - "features": "[union(createArray(createObject('name', 'IsAcceleratedNetworkSupported', 'value', format('{0}', parameters('isAcceleratedNetworkSupported')))), if(and(not(equals(parameters('securityType'), null())), not(equals(parameters('securityType'), 'Standard'))), createArray(createObject('name', 'SecurityType', 'value', format('{0}', parameters('securityType')))), createArray()), if(not(equals(parameters('isHibernateSupported'), null())), createArray(createObject('name', 'IsHibernateSupported', 'value', format('{0}', parameters('isHibernateSupported')))), createArray()))]", + "features": "[union(if(not(equals(parameters('isAcceleratedNetworkSupported'), null())), createArray(createObject('name', 'IsAcceleratedNetworkSupported', 'value', format('{0}', parameters('isAcceleratedNetworkSupported')))), createArray()), if(and(not(equals(parameters('securityType'), null())), not(equals(parameters('securityType'), 'Standard'))), createArray(createObject('name', 'SecurityType', 'value', format('{0}', parameters('securityType')))), createArray()), if(not(equals(parameters('isHibernateSupported'), null())), createArray(createObject('name', 'IsHibernateSupported', 'value', format('{0}', parameters('isHibernateSupported')))), createArray()), if(not(equals(parameters('diskControllerType'), null())), createArray(createObject('name', 'DiskControllerTypes', 'value', format('{0}', parameters('diskControllerType')))), createArray()))]", "hyperVGeneration": "[coalesce(parameters('hyperVGeneration'), if(not(empty(coalesce(parameters('securityType'), ''))), 'V2', 'V1'))]", "identifier": { "publisher": "[parameters('identifier').publisher]", @@ -468,7 +488,7 @@ "metadata": { "description": "The location the resource was deployed into." }, - "value": "[reference('image', '2023-07-03', 'full').location]" + "value": "[reference('image', '2024-03-03', 'full').location]" } } } \ No newline at end of file diff --git a/avm/res/compute/gallery/main.bicep b/avm/res/compute/gallery/main.bicep index 4a85a01615..0902a56202 100644 --- a/avm/res/compute/gallery/main.bicep +++ b/avm/res/compute/gallery/main.bicep @@ -101,7 +101,7 @@ resource avmTelemetry 'Microsoft.Resources/deployments@2024-03-01' = if (enableT } } -resource gallery 'Microsoft.Compute/galleries@2023-07-03' = { +resource gallery 'Microsoft.Compute/galleries@2024-03-03' = { name: name location: location tags: tags @@ -168,6 +168,7 @@ module galleries_images 'image/main.bicep' = [ location: image.?location ?? location galleryName: gallery.name description: image.?description + allowUpdateImage: image.?allowUpdateImage osType: image.osType osState: image.osState identifier: image.identifier @@ -177,6 +178,7 @@ module galleries_images 'image/main.bicep' = [ securityType: image.?securityType isAcceleratedNetworkSupported: image.?isAcceleratedNetworkSupported isHibernateSupported: image.?isHibernateSupported + diskControllerType: image.?diskControllerType architecture: image.?architecture eula: image.?eula privacyStatementUri: image.?privacyStatementUri @@ -226,6 +228,9 @@ type imageType = { @sys.description('Optional. The description of this gallery image definition resource. This property is updatable.') description: string? + @sys.description('Optional. Must be set to true if the gallery image features are being updated.') + allowUpdateImage: bool? + @sys.description('Required. This property allows you to specify the type of the OS that is included in the disk when creating a VM from a managed image.') osType: ('Linux' | 'Windows') @@ -259,6 +264,9 @@ type imageType = { @sys.description('Optional. Specify if the image supports hibernation.') isHibernateSupported: bool? + @sys.description('Optional. The disk controllers that an OS disk supports.') + diskControllerType: ('SCSI' | 'SCSI, NVMe' | 'NVMe, SCSI')? + @sys.description('Optional. The architecture of the image. Applicable to OS disks only.') architecture: ('x64' | 'Arm64')? diff --git a/avm/res/compute/gallery/main.json b/avm/res/compute/gallery/main.json index 87eed5748c..cbcc15f39d 100644 --- a/avm/res/compute/gallery/main.json +++ b/avm/res/compute/gallery/main.json @@ -5,8 +5,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.32.4.45862", - "templateHash": "8716597573060065028" + "version": "0.33.93.31351", + "templateHash": "13276352345178978927" }, "name": "Azure Compute Galleries", "description": "This module deploys an Azure Compute Gallery (formerly known as Shared Image Gallery)." @@ -30,6 +30,13 @@ "description": "Optional. The description of this gallery image definition resource. This property is updatable." } }, + "allowUpdateImage": { + "type": "bool", + "nullable": true, + "metadata": { + "description": "Optional. Must be set to true if the gallery image features are being updated." + } + }, "osType": { "type": "string", "allowedValues": [ @@ -110,6 +117,18 @@ "description": "Optional. Specify if the image supports hibernation." } }, + "diskControllerType": { + "type": "string", + "allowedValues": [ + "NVMe, SCSI", + "SCSI", + "SCSI, NVMe" + ], + "nullable": true, + "metadata": { + "description": "Optional. The disk controllers that an OS disk supports." + } + }, "architecture": { "type": "string", "allowedValues": [ @@ -653,7 +672,7 @@ }, "gallery": { "type": "Microsoft.Compute/galleries", - "apiVersion": "2023-07-03", + "apiVersion": "2024-03-03", "name": "[parameters('name')]", "location": "[parameters('location')]", "tags": "[parameters('tags')]", @@ -757,8 +776,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.32.4.45862", - "templateHash": "7761447372947910331" + "version": "0.33.93.31351", + "templateHash": "8421640590183520512" }, "name": "Compute Galleries Applications", "description": "This module deploys an Azure Compute Gallery Application." @@ -1033,12 +1052,12 @@ "gallery": { "existing": true, "type": "Microsoft.Compute/galleries", - "apiVersion": "2022-03-03", + "apiVersion": "2024-03-03", "name": "[parameters('galleryName')]" }, "application": { "type": "Microsoft.Compute/galleries/applications", - "apiVersion": "2022-03-03", + "apiVersion": "2024-03-03", "name": "[format('{0}/{1}', parameters('galleryName'), parameters('name'))]", "location": "[parameters('location')]", "tags": "[parameters('tags')]", @@ -1102,7 +1121,7 @@ "metadata": { "description": "The location the resource was deployed into." }, - "value": "[reference('application', '2022-03-03', 'full').location]" + "value": "[reference('application', '2024-03-03', 'full').location]" } } } @@ -1137,6 +1156,9 @@ "description": { "value": "[tryGet(coalesce(parameters('images'), createArray())[copyIndex()], 'description')]" }, + "allowUpdateImage": { + "value": "[tryGet(coalesce(parameters('images'), createArray())[copyIndex()], 'allowUpdateImage')]" + }, "osType": { "value": "[coalesce(parameters('images'), createArray())[copyIndex()].osType]" }, @@ -1164,6 +1186,9 @@ "isHibernateSupported": { "value": "[tryGet(coalesce(parameters('images'), createArray())[copyIndex()], 'isHibernateSupported')]" }, + "diskControllerType": { + "value": "[tryGet(coalesce(parameters('images'), createArray())[copyIndex()], 'diskControllerType')]" + }, "architecture": { "value": "[tryGet(coalesce(parameters('images'), createArray())[copyIndex()], 'architecture')]" }, @@ -1201,8 +1226,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.32.4.45862", - "templateHash": "13858460997059168010" + "version": "0.33.93.31351", + "templateHash": "5191633407919649272" }, "name": "Compute Galleries Image Definitions", "description": "This module deploys an Azure Compute Gallery Image Definition." @@ -1481,7 +1506,7 @@ }, "isAcceleratedNetworkSupported": { "type": "bool", - "defaultValue": true, + "nullable": true, "metadata": { "description": "Optional. Specify if the image supports accelerated networking." } @@ -1493,6 +1518,13 @@ "description": "Optional. Specifiy if the image supports hibernation." } }, + "allowUpdateImage": { + "type": "bool", + "nullable": true, + "metadata": { + "description": "Optional. Must be set to true if the gallery image features are being updated." + } + }, "architecture": { "type": "string", "allowedValues": [ @@ -1543,6 +1575,18 @@ "description": "Optional. The hypervisor generation of the Virtual Machine. If this value is not specified, then it is determined by the securityType parameter. If the securityType parameter is specified, then the value of hyperVGeneration will be V2, else V1." } }, + "diskControllerType": { + "type": "string", + "allowedValues": [ + "NVMe, SCSI", + "SCSI", + "SCSI, NVMe" + ], + "nullable": true, + "metadata": { + "description": "Optional. The disk controllers that an OS disk supports." + } + }, "roleAssignments": { "$ref": "#/definitions/roleAssignmentType", "metadata": { @@ -1579,16 +1623,17 @@ "gallery": { "existing": true, "type": "Microsoft.Compute/galleries", - "apiVersion": "2023-07-03", + "apiVersion": "2024-03-03", "name": "[parameters('galleryName')]" }, "image": { "type": "Microsoft.Compute/galleries/images", - "apiVersion": "2023-07-03", + "apiVersion": "2024-03-03", "name": "[format('{0}/{1}', parameters('galleryName'), parameters('name'))]", "location": "[parameters('location')]", "tags": "[parameters('tags')]", "properties": { + "allowUpdateImage": "[if(not(equals(parameters('allowUpdateImage'), null())), parameters('allowUpdateImage'), null())]", "architecture": "[parameters('architecture')]", "description": "[parameters('description')]", "disallowed": { @@ -1596,7 +1641,7 @@ }, "endOfLifeDate": "[parameters('endOfLifeDate')]", "eula": "[parameters('eula')]", - "features": "[union(createArray(createObject('name', 'IsAcceleratedNetworkSupported', 'value', format('{0}', parameters('isAcceleratedNetworkSupported')))), if(and(not(equals(parameters('securityType'), null())), not(equals(parameters('securityType'), 'Standard'))), createArray(createObject('name', 'SecurityType', 'value', format('{0}', parameters('securityType')))), createArray()), if(not(equals(parameters('isHibernateSupported'), null())), createArray(createObject('name', 'IsHibernateSupported', 'value', format('{0}', parameters('isHibernateSupported')))), createArray()))]", + "features": "[union(if(not(equals(parameters('isAcceleratedNetworkSupported'), null())), createArray(createObject('name', 'IsAcceleratedNetworkSupported', 'value', format('{0}', parameters('isAcceleratedNetworkSupported')))), createArray()), if(and(not(equals(parameters('securityType'), null())), not(equals(parameters('securityType'), 'Standard'))), createArray(createObject('name', 'SecurityType', 'value', format('{0}', parameters('securityType')))), createArray()), if(not(equals(parameters('isHibernateSupported'), null())), createArray(createObject('name', 'IsHibernateSupported', 'value', format('{0}', parameters('isHibernateSupported')))), createArray()), if(not(equals(parameters('diskControllerType'), null())), createArray(createObject('name', 'DiskControllerTypes', 'value', format('{0}', parameters('diskControllerType')))), createArray()))]", "hyperVGeneration": "[coalesce(parameters('hyperVGeneration'), if(not(empty(coalesce(parameters('securityType'), ''))), 'V2', 'V1'))]", "identifier": { "publisher": "[parameters('identifier').publisher]", @@ -1664,7 +1709,7 @@ "metadata": { "description": "The location the resource was deployed into." }, - "value": "[reference('image', '2023-07-03', 'full').location]" + "value": "[reference('image', '2024-03-03', 'full').location]" } } } @@ -1701,7 +1746,7 @@ "metadata": { "description": "The location the resource was deployed into." }, - "value": "[reference('gallery', '2023-07-03', 'full').location]" + "value": "[reference('gallery', '2024-03-03', 'full').location]" }, "imageResourceIds": { "type": "array", diff --git a/avm/res/compute/gallery/tests/e2e/max/main.test.bicep b/avm/res/compute/gallery/tests/e2e/max/main.test.bicep index bca3fb8249..c301dea7da 100644 --- a/avm/res/compute/gallery/tests/e2e/max/main.test.bicep +++ b/avm/res/compute/gallery/tests/e2e/max/main.test.bicep @@ -91,6 +91,7 @@ module testDeployment '../../../main.bicep' = [ images: [ { name: '${namePrefix}-az-imgd-ws-001' + allowUpdateImage: true hyperVGeneration: 'V1' identifier: { publisher: 'MicrosoftWindowsServer' @@ -114,6 +115,7 @@ module testDeployment '../../../main.bicep' = [ } { name: '${namePrefix}-az-imgd-ws-002' + allowUpdateImage: false hyperVGeneration: 'V2' identifier: { publisher: 'MicrosoftWindowsServer' @@ -178,6 +180,7 @@ module testDeployment '../../../main.bicep' = [ max: 4 } isAcceleratedNetworkSupported: false + diskControllerType: 'SCSI' } { name: '${namePrefix}-az-imgd-us-005' @@ -198,6 +201,7 @@ module testDeployment '../../../main.bicep' = [ max: 4 } isAcceleratedNetworkSupported: true + diskControllerType: 'SCSI, NVMe' } { name: '${namePrefix}-az-imgd-us-006' @@ -232,6 +236,7 @@ module testDeployment '../../../main.bicep' = [ } releaseNoteUri: 'https://testReleaseNoteUri.com' isAcceleratedNetworkSupported: false + // diskControllerType: 'NVMe, SCSI' // --> needs to remain commented, as there is a bug setting the value starting with 'NVMe' again, which prevents the idem test to pass } ] roleAssignments: [ @@ -262,8 +267,5 @@ module testDeployment '../../../main.bicep' = [ Role: 'DeploymentValidation' } } - dependsOn: [ - nestedDependencies - ] } ] diff --git a/avm/res/compute/gallery/version.json b/avm/res/compute/gallery/version.json index 9a9a06e897..6b6be93891 100644 --- a/avm/res/compute/gallery/version.json +++ b/avm/res/compute/gallery/version.json @@ -1,6 +1,6 @@ { "$schema": "https://aka.ms/bicep-registry-module-version-file-schema#", - "version": "0.8", + "version": "0.9", "pathFilters": [ "./main.json" ]