disks
Summary
Recommendation | Impact | Category | Automation Available | In Azure Advisor |
---|---|---|---|---|
Shared disks should only be enabled in clustered servers | Medium | Other Best Practices | Yes | No |
Use Azure Disks with Zone Redundant Storage for higher resiliency and availability | Medium | High Availability | Yes | Yes |
Details
Shared disks should only be enabled in clustered servers
Impact: Medium Category: Other Best Practices
APRL GUID: 3263a64a-c256-de48-9818-afd3cbc55c2a
Description:
Azure shared disks let you attach a disk to multiple VMs at once for deploying or migrating clustered applications, suitable only when a disk is shared among VM cluster members.
Potential Benefits:
Enhances clustered server performance
Learn More:
Azure Shared Disk Introduction |
Enable Shared Disks |
ARG Query:
Click the Azure Resource Graph tab to view the query
// Azure Resource Graph Query
// Find all Disks configured to be Shared. This is not an indication of an issue, but if a disk with this configuration is assigned to two or more VMs without a proper disk control mechanism (like a WSFC) it can lead to data loss
resources
| where type =~ 'Microsoft.Compute/disks'
| where isnotnull(properties.maxShares) and properties.maxShares >= 2
| project id, name, tags, lowerCaseDiskId = tolower(id), diskState = tostring(properties.diskState)
| join kind = leftouter (
resources
| where type =~ 'Microsoft.Compute/virtualMachines'
| project osDiskVmName = name, lowerCaseOsDiskId = tolower(properties.storageProfile.osDisk.managedDisk.id)
| join kind = fullouter (
resources
| where type =~ 'Microsoft.Compute/virtualMachines'
| mv-expand dataDisks = properties.storageProfile.dataDisks
| project dataDiskVmName = name, lowerCaseDataDiskId = tolower(dataDisks.managedDisk.id)
)
on $left.lowerCaseOsDiskId == $right.lowerCaseDataDiskId
| project lowerCaseDiskId = coalesce(lowerCaseOsDiskId, lowerCaseDataDiskId), vmName = coalesce(osDiskVmName, dataDiskVmName)
)
on lowerCaseDiskId
| summarize vmNames = make_set(vmName) by name, id, tostring(tags), diskState
| extend param1 = strcat("DiskState: ", diskState), param2 = iif(isempty(vmNames[0]), "VMName: n/a", strcat("VMName: ", strcat_array(vmNames, ", ")))
| project recommendationId = "3263a64a-c256-de48-9818-afd3cbc55c2a", name, id, tags, param1, param2
| order by id asc
Use Azure Disks with Zone Redundant Storage for higher resiliency and availability
Impact: Medium Category: High Availability
APRL GUID: fa0cf4f5-0b21-47b7-89a9-ee936f193ce1
Description:
Azure disks offers a zone-redundant storage (ZRS) option for workloads that need to be resilient to an entire zone being down. Due to the cross-zone data replication, ZRS disks have higher write latency when compared to the locally-redundant option (LRS), so make sure to benchmark your disks.
Potential Benefits:
Enhanced Disk resilience to failures
Learn More:
Redundancy options for managed disks |
ARG Query:
Click the Azure Resource Graph tab to view the query
// Azure Resource Graph Query
// Find eligible Disks that are not zonal nor zone redundant
resources
| where type == 'microsoft.compute/disks'
| where location in~ ("australiaeast", "brazilsouth", "canadacentral", "centralindia", "centralus", "eastasia", "eastus", "eastus2", "francecentral", "germanywestcentral", "israelcentral", "italynorth", "japaneast", "japanwest", "koreacentral", "mexicocentral", "newzealandnorth", "northeurope", "norwayeast", "polandcentral", "qatarcentral", "southafricanorth", "southcentralus", "southeastasia", "spaincentral", "swedencentral", "switzerlandnorth", "uaenorth", "uksouth", "westeurope", "westus2", "westus3", "usgovvirginia", "chinanorth3")
| where sku has "Premium_LRS" or sku has "StandardSSD_LRS"
| where sku.name has_cs 'ZRS' or array_length(zones) > 0
| project recommendationId="fa0cf4f5-0b21-47b7-89a9-ee936f193ce1", name, id, tags, param1 = sku, param2 = sku.name