Azure Proactive Resiliency Library v2
Tools Glossary GitHub GitHub Issues Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

virtualMachineScaleSets

Summary

RecommendationImpactCategoryAutomation AvailablePG Verified
VMSS を均一ではなくフレックス オーケストレーション モードで導入するMediumScalabilityYesVerified
Azure 仮想マシン スケール セットのアプリケーション正常性監視を有効にするMediumMonitoring and AlertingYesVerified
Azure 仮想マシン スケール セットで自動修復ポリシーを有効にするHighHigh AvailabilityYesVerified
VMSS 自動スケールをカスタムに構成し、スケーリング メトリックを構成するHighScalabilityYesVerified
予測自動スケーリングを有効にし、少なくとも予測のみを構成しますLowScalabilityYesVerified
スケールインおよびスケールアウトの失敗を回避するために、ゾーン間で厳密に均等なバランスを強制するを無効にします。HighHigh AvailabilityYesVerified
VMSS Flex を使用して可用性ゾーン全体に VMSS を展開するHighHigh AvailabilityYesVerified
パッチ オーケストレーション オプションを Azure でオーケストレーションされたものに設定するLowOther Best PracticesYesVerified
非推奨になる予定またはすでに廃止される予定の VMSS イメージ バージョンをアップグレードするHighGovernanceNoVerified

Details


VMSS を均一ではなくフレックス オーケストレーション モードで導入する

Impact:  Medium Category:  Scalability PG Verified:  Verified

Description:

柔軟なオーケストレーション モードを使用して単一インスタンスの VM をスケール セットにデプロイすることで、アプリケーションのスケーリングと可用性を将来にわたって保証します。このモードは、リージョン内または可用性ゾーン内の障害ドメイン全体に VM を分散することにより、高可用性 (最大 1000 VM) を保証します。

Potential Benefits:

Higher scalability and availability
Learn More:
When to use VMSS instead of VMs
Azure Well-Architected Framework review - Virtual Machines and Scale Sets

ARG Query:

Click the Azure Resource Graph tab to view the query

// Azure Resource Graph Query
// Find all zonal VMs that are NOT deployed with Flex orchestration mode
resources
| where type == "microsoft.compute/virtualmachinescalesets"
| where properties.orchestrationMode != "Flexible"
| project recommendationId = "e7495e1c-0c75-0946-b266-b429b5c7f3bf", name, id, tags, param1 = strcat("orchestrationMode: ", tostring(properties.orchestrationMode))



Azure 仮想マシン スケール セットのアプリケーション正常性監視を有効にする

Impact:  Medium Category:  Monitoring and Alerting PG Verified:  Verified

Description:

Azure Virtual Machine Scale Sets でアプリケーションの正常性を監視することは、デプロイ管理にとって重要です。アップグレードの健全性監視を利用して、OS イメージの自動アップグレードや VM ゲストのパッチ適用などのローリング アップグレードをサポートします。

Potential Benefits:

Enhances deployment management and upgrades
Learn More:
Using Application Health extension with Virtual Machine Scale Sets

ARG Query:

Click the Azure Resource Graph tab to view the query

// Azure Resource Graph Query
// Find all VMs that do NOT have health monitoring enabled
resources
| where type == "microsoft.compute/virtualmachinescalesets"
| join kind=leftouter  (
    resources
    | where type == "microsoft.compute/virtualmachinescalesets"
    | mv-expand extension=properties.virtualMachineProfile.extensionProfile.extensions
    | where extension.properties.type in ( "ApplicationHealthWindows", "ApplicationHealthLinux" )
    | project id
) on id
| where id1 == ""
| project recommendationId = "94794d2a-eff0-2345-9b67-6f9349d0a627", name, id, tags, param1 = "extension: null"



Azure 仮想マシン スケール セットで自動修復ポリシーを有効にする

Impact:  High Category:  High Availability PG Verified:  Verified

Description:

Azure Virtual Machine Scale Sets でインスタンスの自動修復を有効にすると、継続的な健全性チェックとメンテナンス プロセスを通じてアプリケーションの可用性が向上します。

Potential Benefits:

Boosts app availability by auto-repair
Learn More:
Automatic instance repairs for Azure Virtual Machine Scale Sets

ARG Query:

Click the Azure Resource Graph tab to view the query

// Azure Resource Graph Query
// Find all VMs that do NOT have automatic repair policy enabled
resources
| where type == "microsoft.compute/virtualmachinescalesets"
| where properties.automaticRepairsPolicy.enabled == false
| project recommendationId = "820f4743-1f94-e946-ae0b-45efafd87962", name, id, tags, param1 = "automaticRepairsPolicy: Disabled"



VMSS 自動スケールをカスタムに構成し、スケーリング メトリックを構成する

Impact:  High Category:  Scalability PG Verified:  Verified

Description:

メトリクスとスケジュールに基づいて VMSS のカスタム自動スケールを使用して、需要の変化に応じてインスタンスを調整し、パフォーマンスとコスト効率を向上させます。

Potential Benefits:

Enhances performance and cost-efficiency
Learn More:
Get started with autoscale in Azure
Overview of autoscale in Azure

ARG Query:

Click the Azure Resource Graph tab to view the query

// Azure Resource Graph Query
// Find VMSS instances associated with autoscale settings when autoscale is disabled
resources
| where type == "microsoft.compute/virtualmachinescalesets"
| project name, id, tags
| join kind=leftouter  (
    resources
    | where type == "microsoft.insights/autoscalesettings"
    | where tostring(properties.targetResourceUri) contains "Microsoft.Compute/virtualMachineScaleSets"
    | project id = tostring(properties.targetResourceUri), autoscalesettings = properties
) on id
| where isnull(autoscalesettings) or autoscalesettings.enabled == "false"
| project recommendationId = "ee66ff65-9aa3-2345-93c1-25827cf79f44", name, id, tags, param1 = "autoscalesettings: Disabled"
| order by id asc



予測自動スケーリングを有効にし、少なくとも予測のみを構成します

Impact:  Low Category:  Scalability PG Verified:  Verified

Description:

予測自動スケールでは、機械学習を利用して、使用状況の履歴分析を通じて CPU 負荷を予測することで、Azure 仮想マシン スケール セットを効率的に管理およびスケーリングし、需要を満たすタイムリーなスケールアウトを保証します。

Potential Benefits:

Optimizes scaling with ML predictions
Learn More:
Use predictive autoscale to scale out before load demands in virtual machine scale sets

ARG Query:

Click the Azure Resource Graph tab to view the query

// Azure Resource Graph Query
// Find VMSS instances associated with autoscale settings when predictiveAutoscalePolicy_scaleMode is disabled
resources
| where type == "microsoft.compute/virtualmachinescalesets"
| project name, id, tags
| join kind=leftouter  (
    resources
    | where type == "microsoft.insights/autoscalesettings"
    | where tostring(properties.targetResourceUri) contains "Microsoft.Compute/virtualMachineScaleSets"
    | project id = tostring(properties.targetResourceUri), autoscalesettings = properties
) on id
| where autoscalesettings.enabled == "true" and autoscalesettings.predictiveAutoscalePolicy.scaleMode == "Disabled"
| project recommendationId = "3f85a51c-e286-9f44-b4dc-51d00768696c", name, id, tags, param1 = "predictiveAutoscalePolicy_scaleMode: Disabled"
| order by id asc



スケールインおよびスケールアウトの失敗を回避するために、ゾーン間で厳密に均等なバランスを強制するを無効にします。

Impact:  High Category:  High Availability PG Verified:  Verified

Description:

Microsoft は、スケーラビリティと柔軟性を向上させるために、VMSS の可用性ゾーン全体で VM インスタンスの均等な分散を完全に無効にすることを推奨しており、耐障害性の潜在的なトレードオフにもかかわらず、不均一な分散の方がアプリケーションの負荷需要にうまく対応できる可能性があることに注意しています。

Potential Benefits:

Improves scaling, reduces fail attempts
Learn More:
Use scale-in policies with Azure Virtual Machine Scale Sets

ARG Query:

Click the Azure Resource Graph tab to view the query

// Azure Resource Graph Query
// Find VMSS instances where strictly zoneBalance is set to True
resources
| where type == "microsoft.compute/virtualmachinescalesets"
| where properties.orchestrationMode == "Uniform" and properties.zoneBalance == true
| project recommendationId = "b5a63aa0-c58e-244f-b8a6-cbba0560a6db", name, id, tags, param1 = "strictly zoneBalance: Enabled"
| order by id asc



VMSS Flex を使用して可用性ゾーン全体に VMSS を展開する

Impact:  High Category:  High Availability PG Verified:  Verified

Description:

VMSS を作成するときは、データセンター障害というまれなイベントに対するアプリケーションとデータの保護手段として可用性ゾーンを実装します。

Potential Benefits:

Enhances disaster resilience
Learn More:
Create a Virtual Machine Scale Set that uses Availability Zones
Update scale set to add availability zones

ARG Query:

Click the Azure Resource Graph tab to view the query

// Azure Resource Graph Query
// Find VMSS instances with one or no Zones selected
resources
| where type == "microsoft.compute/virtualmachinescalesets"
| where array_length(zones) <= 1 or isnull(zones)
| project recommendationId = "1422c567-782c-7148-ac7c-5fc14cf45adc", name, id, tags, param1 = "AvailabilityZones: Single Zone"
| order by id asc



パッチ オーケストレーション オプションを Azure でオーケストレーションされたものに設定する

Impact:  Low Category:  Other Best Practices PG Verified:  Verified

Description:

VM ゲストの自動パッチ適用を有効にすると、仮想マシンに安全に自動的にパッチを適用してセキュリティ コンプライアンスを維持し、同時に VM の影響範囲を制限できるため、更新管理が容易になります。 KQL は均一オーケストレーションを使用したセットを返さないことに注意してください。

Potential Benefits:

Eases patch management, enhances security
Learn More:
Automatic VM Guest Patching for Azure VMs
Auto OS Image Upgrades

ARG Query:

Click the Azure Resource Graph tab to view the query

// Azure Resource Graph query
// Identifies VMs and VMSS with manual patch settings, excluding automatic patch modes
resources
| where type == "microsoft.compute/virtualmachinescalesets"
| join kind=inner (
    resources
    | where type == "microsoft.compute/virtualmachines"
    | project id = tostring(properties.virtualMachineScaleSet.id), vmproperties = properties
) on id
| extend recommendationId = "e4ffd7b0-ba24-c84e-9352-ba4819f908c0", param1 = "patchMode: Manual", vmproperties.osProfile.linuxConfiguration.patchSettings.patchMode
| where isnotnull(vmproperties.osProfile.linuxConfiguration) and vmproperties.osProfile.linuxConfiguration.patchSettings.patchMode !in ("AutomaticByPlatform", "AutomaticByOS")
| distinct recommendationId, name, id, param1
| union (resources
| where type == "microsoft.compute/virtualmachinescalesets"
| join kind=inner (
    resources
    | where type == "microsoft.compute/virtualmachines"
    | project id = tostring(properties.virtualMachineScaleSet.id), vmproperties = properties
) on id
| extend recommendationId = "e4ffd7b0-ba24-c84e-9352-ba4819f908c0", param1 = "patchMode: Manual", vmproperties.osProfile.windowsConfiguration.patchSettings.patchMode
| where isnotnull(vmproperties.osProfile.windowsConfiguration) and vmproperties.osProfile.windowsConfiguration.patchSettings.patchMode !in ("AutomaticByPlatform", "AutomaticByOS")
| distinct recommendationId, name, id, param1)



非推奨になる予定またはすでに廃止される予定の VMSS イメージ バージョンをアップグレードする

Impact:  High Category:  Governance PG Verified:  Verified

Description:

イメージの廃止後の中断を避けるために、イメージの現在のバージョンが使用されていることを確認してください。 VM の発行者、オファー、SKU 情報を確認して、サポートされているイメージで実行していることを確認してください。イメージの廃止に関する通知を受け取るには、自動ゲスト パッチ適用またはイメージ アップグレードを有効にします。

Potential Benefits:

Avoid disruptions by updating VMSS images.
Learn More:
Deprecated Azure Marketplace images

ARG Query:

Click the Azure Resource Graph tab to view the query

//cannot-be-validated-with-arg