Skip to content

Commit a81f85b

Browse files
Merge pull request #275652 from AdamZLi/patch-27
Update disks-convert-types.md
2 parents e2230ce + 792def6 commit a81f85b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

articles/virtual-machines/disks-convert-types.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,14 +272,17 @@ location=eastus
272272
logicalSectorSize=512
273273
#Select an Availability Zone, acceptable values are 1,2, or 3
274274
zone=1
275+
#Enter your disk size in GiB, disk size cannot be smaller than snapshot size
276+
diskSize=128
275277
276-
# Get the disk you need to backup
278+
279+
# Get the disk you need to create snapshot
277280
yourDiskID=$(az disk show -n $diskName -g $resourceGroupName --query "id" --output tsv)
278281
279282
# Create the snapshot
280-
snapshot=$(az snapshot create -g $resourceGroupName -n $snapshotName --source $yourDiskID --incremental true)
283+
snapshot=$(az snapshot create -g $resourceGroupName -n $snapshotName --source $yourDiskID --incremental true --query "id" -o tsv)
281284
282-
az disk create -g $resourceGroupName -n $newDiskName --source $snapshot --logical-sector-size $logicalSectorSize --location $location --zone $zone --sku $storageType
285+
az disk create -g $resourceGroupName -n $newDiskName --source $snapshot --logical-sector-size $logicalSectorSize --location $location --zone $zone --sku $storageType --size-gb $diskSize
283286
284287
```
285288

0 commit comments

Comments
 (0)