Skip to content

Commit 9cf9b3b

Browse files
Merge pull request #221030 from roygara/expandSizeCheck
Expand without downtime classic VM SKU script
2 parents e30ae16 + bd5a0ec commit 9cf9b3b

File tree

3 files changed

+54
-28
lines changed

3 files changed

+54
-28
lines changed

articles/virtual-machines/linux/expand-disks.md

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ author: pagienge
55
ms.service: storage
66
ms.collection: linux
77
ms.topic: how-to
8-
ms.date: 09/07/2022
8+
ms.date: 12/09/2022
99
ms.author: pagienge
1010
ms.subservice: disks
1111
ms.custom: references_regions, ignite-fall-2021, devx-track-azurecli
@@ -75,8 +75,6 @@ az feature show --namespace Microsoft.Compute --name LiveResize
7575

7676
### Expand Azure Managed Disk
7777

78-
# [Azure CLI](#tab/azure-cli)
79-
8078
Make sure that you have the latest [Azure CLI](/cli/azure/install-az-cli2) installed and are signed in to an Azure account by using [az login](/cli/azure/reference-index#az-login).
8179

8280
This article requires an existing VM in Azure with at least one data disk attached and prepared. If you do not already have a VM that you can use, see [Create and prepare a VM with data disks](tutorial-manage-disks.md#create-and-attach-disks).
@@ -122,8 +120,6 @@ In the following samples, replace example parameter names such as *myResourceGro
122120
az vm start --resource-group myResourceGroup --name myVM
123121
```
124122
125-
---
126-
127123
## Expand a disk partition and filesystem
128124
> [!NOTE]
129125
> While there are many tools that may be used for performing the partition resizing, the tools detailed in the remainder of this document are the same tools used by certain automated processes such as cloud-init. As described here, the `growpart` tool with the `gdisk` package provides universal compatibility with GUID Partition Table (GPT) disks, as older versions of some tools such as `fdisk` did not support GPT.
@@ -615,3 +611,29 @@ To increase the OS disk size in SUSE 12 SP4, SUSE SLES 12 for SAP, SUSE SLES 15,
615611
/dev/sdb1 3.9G 16M 3.7G 1% /mnt/resource
616612
tmpfs 93M 0 93M 0% /run/user/1000
617613
```
614+
615+
---
616+
617+
## Expanding without downtime classic VM SKU support
618+
619+
If you're using a classic VM SKU, it might not support expanding disks without downtime.
620+
621+
Use the following PowerShell script to determine which VM SKUs it's available with:
622+
623+
```azurepowershell
624+
Connect-AzAccount
625+
$subscriptionId="yourSubID"
626+
$location="desiredRegion"
627+
Set-AzContext -Subscription $subscriptionId
628+
$vmSizes=Get-AzComputeResourceSku -Location $location | where{$_.ResourceType -eq 'virtualMachines'}
629+
630+
foreach($vmSize in $vmSizes){
631+
foreach($capability in $vmSize.Capabilities)
632+
{
633+
if(($capability.Name -eq "EphemeralOSDiskSupported" -and $capability.Value -eq "True") -or ($capability.Name -eq "PremiumIO" -and $capability.Value -eq "True") -or ($capability.Name -eq "HyperVGenerations" -and $capability.Value -match "V2"))
634+
{
635+
$vmSize.Name
636+
}
637+
}
638+
}
639+
```

articles/virtual-machines/windows/expand-os-disk.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ manager: roshar
66
ms.service: storage
77
ms.collection: windows
88
ms.topic: article
9-
ms.date: 09/08/2022
9+
ms.date: 12/09/2022
1010
ms.author: kirpas
1111
ms.subservice: disks
1212
ms.custom: devx-track-azurepowershell, references_regions, ignite-fall-2021
@@ -151,6 +151,30 @@ When you've expanded the disk for the VM, you need to go into the OS and expand
151151

152152
:::image type="content" source="media/expand-os-disk/disk-mgr-3.png" alt-text="Screenshot showing the larger C: volume in Disk Manager.":::
153153

154+
## Expanding without downtime classic VM SKU support
155+
156+
If you're using a classic VM SKU, it might not support expanding disks without downtime.
157+
158+
Use the following PowerShell script to determine which VM SKUs it's available with:
159+
160+
```azurepowershell
161+
Connect-AzAccount
162+
$subscriptionId="yourSubID"
163+
$location="desiredRegion"
164+
Set-AzContext -Subscription $subscriptionId
165+
$vmSizes=Get-AzComputeResourceSku -Location $location | where{$_.ResourceType -eq 'virtualMachines'}
166+
167+
foreach($vmSize in $vmSizes){
168+
foreach($capability in $vmSize.Capabilities)
169+
{
170+
if(($capability.Name -eq "EphemeralOSDiskSupported" -and $capability.Value -eq "True") -or ($capability.Name -eq "PremiumIO" -and $capability.Value -eq "True") -or ($capability.Name -eq "HyperVGenerations" -and $capability.Value -match "V2"))
171+
{
172+
$vmSize.Name
173+
}
174+
}
175+
}
176+
```
177+
154178
## Next steps
155179

156180
You can also attach disks using the [Azure portal](attach-managed-disk-portal.md).

includes/virtual-machines-disks-expand-without-downtime-restrictions.md

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55
author: roygara
66
ms.service: virtual-machines
77
ms.topic: include
8-
ms.date: 10/14/2022
8+
ms.date: 12/09/2022
99
ms.author: rogarana
1010
ms.custom: include file
1111
---
12-
- Only available with particular VM SKUs.
1312
- Only supported for data disks.
1413
- If a disk is 4 TiB or less, you can't expand it beyond 4 TiB without deallocating the VM. If a disk is already greater than 4 TiB, you can expand it without deallocating the VM.
1514
- Not supported for Ultra disks or Premium SSD v2 disks.
@@ -19,23 +18,4 @@
1918
- The [latest Azure PowerShell module](/powershell/azure/install-az-ps)
2019
- The [Azure portal](https://portal.azure.com/)
2120
- Or an Azure Resource Manager template with an API version that's `2021-04-01` or newer.
22-
23-
Use the following PowerShell script to determine which VM SKUs it's available with:
24-
25-
```azurepowershell
26-
Connect-AzAccount
27-
$subscriptionId="yourSubID"
28-
$location="desiredRegion"
29-
Set-AzContext -Subscription $subscriptionId
30-
$vmSizes=Get-AzComputeResourceSku -Location $location | where{$_.ResourceType -eq 'virtualMachines'}
31-
32-
foreach($vmSize in $vmSizes){
33-
foreach($capability in $vmSize.Capabilities)
34-
{
35-
if(($capability.Name -eq "EphemeralOSDiskSupported" -and $capability.Value -eq "True") -or ($capability.Name -eq "PremiumIO" -and $capability.Value -eq "True") -or ($capability.Name -eq "HyperVGenerations" -and $capability.Value -match "V2"))
36-
{
37-
$vmSize.Name
38-
}
39-
}
40-
}
41-
```
21+
- Not available on some classic VMs. Use [this script](#expanding-without-downtime-classic-vm-sku-support) to get a list of classic VM SKUs that support expanding without downtime.

0 commit comments

Comments
 (0)