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

Fix bicep vm data disks #13984

Merged
merged 4 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,18 @@
},
"dataDiskParams": {
"value": [{
"diskSizeGB": 32
"diskSizeGB": 32,
"dynamic": true
}]
},
"domainToJoin":{
"value": "GEN-UNIQUE"
"value": ""
},
"domainJoinUsername": {
"value": "GEN-UNIQUE"
"value": ""
},
"domainJoinPassword": {
"value": "GEN-UNIQUE"
"value": ""
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ param memoryMB int = 8192
param adminUsername string
@description('The name of a Marketplace Gallery Image already downloaded to the Azure Stack HCI cluster. For example: winServer2022-01')
param imageName string
@description('The name of an existing Logical Network in your HCI cluster - for example: vnet-compute-vlan240-dhcp')
@description('The name of an existing Logical Network in your HCI cluster - for example: lnet-compute-vlan240-dhcp')
param hciLogicalNetworkName string
@description('The name of the custom location to use for the deployment. This name is specified during the deployment of the Azure Stack HCI cluster and can be found on the Azure Stack HCI cluster resource Overview in the Azure portal.')
param customLocationName string
Expand All @@ -24,19 +24,17 @@ param domainJoinUserName string = ''
@secure()
param domainJoinPassword string = ''

//define a custom type for the dataDiskParams parameter and array of disks
type dataDiskType = {
diskSizeGB: int
dynamic: bool?
//containerId: string
}
type dataDiskArrayType = dataDiskType[]

@description('The bicep array description of the dataDisks to attached to the vm. Provide an empty array for no addtional disks, or an array following the example below.')
// param dataDiskParams array = []
param dataDiskParams array = [
{
diskSizeGB: 8
dynamic: true
//containerId: specify a container ID to target a specific CSV/storage path in your HCI cluster
}
{
diskSizeGB: 16
dynamic: false
}
]
// param dataDiskParams array = [{'diskSizeGB': 1024,'dynamic': true},{'diskSizeGB': 2048,'dynamic': false}]
param dataDiskParams dataDiskArrayType = []

var nicName = 'nic-${name}' // name of the NIC to be created
var customLocationId = resourceId('Microsoft.ExtendedLocation/customLocations', customLocationName) // full custom location ID
Expand Down Expand Up @@ -85,7 +83,7 @@ resource dataDisks 'Microsoft.AzureStackHCI/virtualHardDisks@2023-09-01-preview'
}
properties: {
diskSizeGB: disk.diskSizeGB
dynamic: disk.dynamic
dynamic: disk.?dynamic // dynamic is optional
// containerId: uncomment if you want to target a specific CSV/storage path in your HCI cluster
}
}]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ param customLocationName string

var customLocationId = resourceId('Microsoft.ExtendedLocation/customLocations', customLocationName)

resource marketplaceGalleryImage 'Microsoft.AzureStackHCI/marketplaceGalleryImages@2023-09-01-preview' = {
resource marketplaceGalleryImage 'Microsoft.AzureStackHCI/marketplaceGalleryImages@2024-01-01' = {
name: 'MicrosoftWindowsServer'
location: location
extendedLocation: {
Expand All @@ -43,7 +43,7 @@ resource marketplaceGalleryImage 'Microsoft.AzureStackHCI/marketplaceGalleryImag
}
}

resource virtualNetwork 'Microsoft.AzureStackHCI/logicalNetworks@2023-09-01-preview' = {
resource virtualNetwork 'Microsoft.AzureStackHCI/logicalNetworks@2024-01-01' = {
name: logicalNetworkName
location: location
extendedLocation: {
Expand Down