diff --git a/modules/Microsoft.Compute/availabilitySets/.test/common/deploy.test.bicep b/modules/Microsoft.Compute/availabilitySets/.test/common/deploy.test.bicep index 4430970bd9..0655c2f798 100644 --- a/modules/Microsoft.Compute/availabilitySets/.test/common/deploy.test.bicep +++ b/modules/Microsoft.Compute/availabilitySets/.test/common/deploy.test.bicep @@ -48,7 +48,7 @@ module testDeployment '../../deploy.bicep' = { enableDefaultTelemetry: enableDefaultTelemetry name: '<>${serviceShort}001' lock: 'CanNotDelete' - proximityPlacementGroupId: nestedDependencies.outputs.proximityPlacementGroupResourceId + proximityPlacementGroupResourceId: nestedDependencies.outputs.proximityPlacementGroupResourceId roleAssignments: [ { roleDefinitionIdOrName: 'Reader' diff --git a/modules/Microsoft.Compute/availabilitySets/deploy.bicep b/modules/Microsoft.Compute/availabilitySets/deploy.bicep index 0348896f42..1a0d4a1476 100644 --- a/modules/Microsoft.Compute/availabilitySets/deploy.bicep +++ b/modules/Microsoft.Compute/availabilitySets/deploy.bicep @@ -2,19 +2,19 @@ param name string @description('Optional. The number of fault domains to use.') -param availabilitySetFaultDomain int = 2 +param platformFaultDomainCount int = 2 @description('Optional. The number of update domains to use.') -param availabilitySetUpdateDomain int = 5 +param platformUpdateDomainCount int = 5 @description('''Optional. SKU of the availability set. - Use \'Aligned\' for virtual machines with managed disks. - Use \'Classic\' for virtual machines with unmanaged disks. ''') -param availabilitySetSku string = 'Aligned' +param skuName string = 'Aligned' @description('Optional. Resource ID of a proximity placement group.') -param proximityPlacementGroupId string = '' +param proximityPlacementGroupResourceId string = '' @description('Optional. Resource location.') param location string = resourceGroup().location @@ -53,14 +53,14 @@ resource availabilitySet 'Microsoft.Compute/availabilitySets@2022-11-01' = { location: location tags: tags properties: { - platformFaultDomainCount: availabilitySetFaultDomain - platformUpdateDomainCount: availabilitySetUpdateDomain - proximityPlacementGroup: !empty(proximityPlacementGroupId) ? { - id: proximityPlacementGroupId + platformFaultDomainCount: platformFaultDomainCount + platformUpdateDomainCount: platformUpdateDomainCount + proximityPlacementGroup: !empty(proximityPlacementGroupResourceId) ? { + id: proximityPlacementGroupResourceId } : null } sku: { - name: availabilitySetSku + name: skuName } } diff --git a/modules/Microsoft.Compute/availabilitySets/readme.md b/modules/Microsoft.Compute/availabilitySets/readme.md index 8a3f80b79f..2fd77e91a3 100644 --- a/modules/Microsoft.Compute/availabilitySets/readme.md +++ b/modules/Microsoft.Compute/availabilitySets/readme.md @@ -30,14 +30,14 @@ This template deploys an availability set | Parameter Name | Type | Default Value | Allowed Values | Description | | :-- | :-- | :-- | :-- | :-- | -| `availabilitySetFaultDomain` | int | `2` | | The number of fault domains to use. | -| `availabilitySetSku` | string | `'Aligned'` | | SKU of the availability set.

- Use \'Aligned\' for virtual machines with managed disks.

- Use \'Classic\' for virtual machines with unmanaged disks.

| -| `availabilitySetUpdateDomain` | int | `5` | | The number of update domains to use. | | `enableDefaultTelemetry` | bool | `True` | | Enable telemetry via a Globally Unique Identifier (GUID). | | `location` | string | `[resourceGroup().location]` | | Resource location. | | `lock` | string | `''` | `['', CanNotDelete, ReadOnly]` | Specify the type of lock. | -| `proximityPlacementGroupId` | string | `''` | | Resource ID of a proximity placement group. | +| `platformFaultDomainCount` | int | `2` | | The number of fault domains to use. | +| `platformUpdateDomainCount` | int | `5` | | The number of update domains to use. | +| `proximityPlacementGroupResourceId` | string | `''` | | Resource ID of a proximity placement group. | | `roleAssignments` | array | `[]` | | Array of role assignment objects that contain the 'roleDefinitionIdOrName' and 'principalId' to define RBAC role assignments on this resource. In the roleDefinitionIdOrName attribute, you can provide either the display name of the role definition, or its fully qualified ID in the following format: '/providers/Microsoft.Authorization/roleDefinitions/c2f4ef07-c644-48eb-af81-4b1b4947fb11'. | +| `skuName` | string | `'Aligned'` | | SKU of the availability set.

- Use \'Aligned\' for virtual machines with managed disks.

- Use \'Classic\' for virtual machines with unmanaged disks.

| | `tags` | object | `{object}` | | Tags of the availability set resource. | @@ -176,7 +176,7 @@ module availabilitySets './Microsoft.Compute/availabilitySets/deploy.bicep' = { // Non-required parameters enableDefaultTelemetry: '' lock: 'CanNotDelete' - proximityPlacementGroupId: '' + proximityPlacementGroupResourceId: '' roleAssignments: [ { principalIds: [ @@ -217,8 +217,8 @@ module availabilitySets './Microsoft.Compute/availabilitySets/deploy.bicep' = { "lock": { "value": "CanNotDelete" }, - "proximityPlacementGroupId": { - "value": "" + "proximityPlacementGroupResourceId": { + "value": "" }, "roleAssignments": { "value": [ diff --git a/modules/Microsoft.ContainerService/managedClusters/.test/azure/dependencies.bicep b/modules/Microsoft.ContainerService/managedClusters/.test/azure/dependencies.bicep index 04a8a3c003..87c51650c0 100644 --- a/modules/Microsoft.ContainerService/managedClusters/.test/azure/dependencies.bicep +++ b/modules/Microsoft.ContainerService/managedClusters/.test/azure/dependencies.bicep @@ -13,6 +13,9 @@ param diskEncryptionSetName string @description('Required. The name of the Key Vault to create.') param keyVaultName string +@description('Required. The name of the Proximity Placement Group to create.') +param proximityPlacementGroupName string + resource virtualNetwork 'Microsoft.Network/virtualNetworks@2022-09-01' = { name: virtualNetworkName location: location @@ -103,6 +106,11 @@ resource keyPermissions 'Microsoft.Authorization/roleAssignments@2022-04-01' = { } } +resource proximityPlacementGroup 'Microsoft.Compute/proximityPlacementGroups@2022-03-01' = { + name: proximityPlacementGroupName + location: location +} + @description('The resource ID of the created Virtual Network Subnet.') output subnetResourceIds array = [ virtualNetwork.properties.subnets[0].id @@ -115,3 +123,6 @@ output managedIdentityPrincipalId string = managedIdentity.properties.principalI @description('The resource ID of the created Disk Encryption Set.') output diskEncryptionSetResourceId string = diskEncryptionSet.id + +@description('The resource ID of the created Proximity Placement Group.') +output proximityPlacementGroupResourceId string = proximityPlacementGroup.id diff --git a/modules/Microsoft.ContainerService/managedClusters/.test/azure/deploy.test.bicep b/modules/Microsoft.ContainerService/managedClusters/.test/azure/deploy.test.bicep index d8380c5e2a..4ff09b1713 100644 --- a/modules/Microsoft.ContainerService/managedClusters/.test/azure/deploy.test.bicep +++ b/modules/Microsoft.ContainerService/managedClusters/.test/azure/deploy.test.bicep @@ -38,6 +38,7 @@ module nestedDependencies 'dependencies.bicep' = { virtualNetworkName: 'dep-<>-vnet-${serviceShort}' managedIdentityName: 'dep-<>-msi-${serviceShort}' diskEncryptionSetName: 'dep-<>-des-${serviceShort}' + proximityPlacementGroupName: 'dep-<>-ppg-${serviceShort}' // Adding base time to make the name unique as purge protection must be enabled (but may not be longer than 24 characters total) keyVaultName: 'dep-<>-kv-${serviceShort}-${substring(uniqueString(baseTime), 0, 3)}' } @@ -113,6 +114,7 @@ module testDeployment '../../deploy.bicep' = { type: 'VirtualMachineScaleSets' vmSize: 'Standard_DS2_v2' vnetSubnetID: nestedDependencies.outputs.subnetResourceIds[1] + proximityPlacementGroupResourceId: nestedDependencies.outputs.proximityPlacementGroupResourceId } { availabilityZones: [ diff --git a/modules/Microsoft.ContainerService/managedClusters/agentPools/deploy.bicep b/modules/Microsoft.ContainerService/managedClusters/agentPools/deploy.bicep index c5174ef974..016e1d3457 100644 --- a/modules/Microsoft.ContainerService/managedClusters/agentPools/deploy.bicep +++ b/modules/Microsoft.ContainerService/managedClusters/agentPools/deploy.bicep @@ -1,5 +1,4 @@ @description('Conditional. The name of the parent managed cluster. Required if the template is used in a standalone deployment.') -@minLength(1) param managedClusterName string @description('Required. Name of the agent pool.') @@ -99,7 +98,7 @@ param osType string = 'Linux' param podSubnetId string = '' @description('Optional. The ID for the Proximity Placement Group.') -param proximityPlacementGroupId string = '' +param proximityPlacementGroupResourceId string = '' @description('Optional. Describes how VMs are added to or removed from Agent Pools. See billing states (https://learn.microsoft.com/en-us/azure/virtual-machines/states-billing).') @allowed([ @@ -198,7 +197,7 @@ resource agentPool 'Microsoft.ContainerService/managedClusters/agentPools@2022-1 osSKU: !empty(osSku) ? any(osSku) : null osType: osType podSubnetID: !empty(podSubnetId) ? podSubnetId : null - proximityPlacementGroupID: !empty(proximityPlacementGroupId) ? proximityPlacementGroupId : null + proximityPlacementGroupID: !empty(proximityPlacementGroupResourceId) ? proximityPlacementGroupResourceId : null scaleDownMode: scaleDownMode scaleSetEvictionPolicy: scaleSetEvictionPolicy scaleSetPriority: !empty(scaleSetPriority) ? any(scaleSetPriority) : null diff --git a/modules/Microsoft.ContainerService/managedClusters/agentPools/readme.md b/modules/Microsoft.ContainerService/managedClusters/agentPools/readme.md index 6de04c13b0..7ab6fbcdcf 100644 --- a/modules/Microsoft.ContainerService/managedClusters/agentPools/readme.md +++ b/modules/Microsoft.ContainerService/managedClusters/agentPools/readme.md @@ -57,7 +57,7 @@ This module deploys an Agent Pool for a Container Service Managed Cluster | `osSku` | string | `''` | `['', CBLMariner, Ubuntu]` | Specifies an OS SKU. This value must not be specified if OSType is Windows. | | `osType` | string | `'Linux'` | `[Linux, Windows]` | The operating system type. The default is Linux. | | `podSubnetId` | string | `''` | | Subnet ID for the pod IPs. If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. | -| `proximityPlacementGroupId` | string | `''` | | The ID for the Proximity Placement Group. | +| `proximityPlacementGroupResourceId` | string | `''` | | The ID for the Proximity Placement Group. | | `scaleDownMode` | string | `'Delete'` | `[Deallocate, Delete]` | Describes how VMs are added to or removed from Agent Pools. See billing states (https://learn.microsoft.com/en-us/azure/virtual-machines/states-billing). | | `scaleSetEvictionPolicy` | string | `'Delete'` | `[Deallocate, Delete]` | The eviction policy specifies what to do with the VM when it is evicted. The default is Delete. For more information about eviction see spot VMs. | | `scaleSetPriority` | string | `''` | `['', Regular, Spot]` | The Virtual Machine Scale Set priority. | diff --git a/modules/Microsoft.ContainerService/managedClusters/deploy.bicep b/modules/Microsoft.ContainerService/managedClusters/deploy.bicep index 968d3c5102..724057fce1 100644 --- a/modules/Microsoft.ContainerService/managedClusters/deploy.bicep +++ b/modules/Microsoft.ContainerService/managedClusters/deploy.bicep @@ -552,7 +552,7 @@ module managedCluster_agentPools 'agentPools/deploy.bicep' = [for (agentPool, in osSku: contains(agentPool, 'osSku') ? agentPool.osSku : '' osType: contains(agentPool, 'osType') ? agentPool.osType : 'Linux' podSubnetId: contains(agentPool, 'podSubnetId') ? agentPool.podSubnetId : '' - proximityPlacementGroupId: contains(agentPool, 'proximityPlacementGroupId') ? agentPool.proximityPlacementGroupId : '' + proximityPlacementGroupResourceId: contains(agentPool, 'proximityPlacementGroupResourceId') ? agentPool.proximityPlacementGroupResourceId : '' scaleDownMode: contains(agentPool, 'scaleDownMode') ? agentPool.scaleDownMode : 'Delete' scaleSetEvictionPolicy: contains(agentPool, 'scaleSetEvictionPolicy') ? agentPool.scaleSetEvictionPolicy : 'Delete' scaleSetPriority: contains(agentPool, 'scaleSetPriority') ? agentPool.scaleSetPriority : '' diff --git a/modules/Microsoft.ContainerService/managedClusters/readme.md b/modules/Microsoft.ContainerService/managedClusters/readme.md index d8cdfe9e47..9a897b4ef0 100644 --- a/modules/Microsoft.ContainerService/managedClusters/readme.md +++ b/modules/Microsoft.ContainerService/managedClusters/readme.md @@ -437,6 +437,7 @@ module managedClusters './Microsoft.ContainerService/managedClusters/deploy.bice ] osDiskSizeGB: 128 osType: 'Linux' + proximityPlacementGroupResourceId: '' scaleSetEvictionPolicy: 'Delete' scaleSetPriority: 'Regular' storageProfile: 'ManagedDisks' @@ -614,6 +615,7 @@ module managedClusters './Microsoft.ContainerService/managedClusters/deploy.bice ], "osDiskSizeGB": 128, "osType": "Linux", + "proximityPlacementGroupResourceId": "", "scaleSetEvictionPolicy": "Delete", "scaleSetPriority": "Regular", "storageProfile": "ManagedDisks",