Skip to content

Commit e7dfd41

Browse files
authored
Merge pull request #183264 from roygara/sharedExisting
Adding instructions for making an existing disk shared
2 parents ac2f4d6 + 3f06dc4 commit e7dfd41

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

articles/virtual-machines/disks-shared-enable.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Configure an Azure managed disk with shared disks so that you can s
44
author: roygara
55
ms.service: storage
66
ms.topic: how-to
7-
ms.date: 09/01/2021
7+
ms.date: 01/13/2022
88
ms.author: rogarana
99
ms.subservice: disks
1010
ms.custom: devx-track-azurecli, devx-track-azurepowershell
@@ -267,6 +267,31 @@ Before using the following template, replace `[parameters('dataDiskName')]`, `[r
267267

268268
---
269269

270+
## Share an existing disk
271+
272+
To share an existing disk, or update how many VMs it can mount to, set the `maxShares` parameter with either the Azure PowerShell module or Azure CLI. You can also set `maxShares` to 1, if you want to disable sharing.
273+
274+
> [!IMPORTANT]
275+
> The value of `maxShares` can only be set or changed when a disk is unmounted from all VMs. See the [Disk sizes](#disk-sizes) for the allowed values for `maxShares`.
276+
> Before detaching a disk, record the LUN ID for when you re-attach it.
277+
278+
### PowerShell
279+
280+
```azurepowershell
281+
$datadiskconfig = Get-AzDisk -DiskName "mySharedDisk"
282+
$datadiskconfig.maxShares = 3
283+
284+
Update-AzDisk -ResourceGroupName 'myResourceGroup' -DiskName 'mySharedDisk' -Disk $datadiskconfig
285+
```
286+
287+
### CLI
288+
289+
```azurecli
290+
#Modifying a disk to enable or modify sharing configuration
291+
292+
az disk update --name mySharedDisk --max-shares 5
293+
```
294+
270295
## Using Azure shared disks with your VMs
271296

272297
Once you've deployed a shared disk with `maxShares>1`, you can mount the disk to one or more of your VMs.

0 commit comments

Comments
 (0)