Skip to content

Commit 9e3a70e

Browse files
authored
Merge pull request #16316 from v-sissondan/download-managed-data-disks
Download managed data disks - Azure Local
2 parents 619bfe6 + 90e9e7c commit 9e3a70e

File tree

2 files changed

+109
-0
lines changed

2 files changed

+109
-0
lines changed

azure-local/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,8 @@ items:
425425
href: manage/manage-thin-provisioning-23h2.md
426426
- name: Use ReFS deduplication and compression
427427
href: manage/refs-deduplication-and-compression.md
428+
- name: Download managed data disks
429+
href: manage/manage-data-disks.md
428430

429431
- name: Capacity
430432
items:
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
---
2+
title: Download Azure managed disk to Azure Local
3+
description: Learn how to download Azure managed disk to Azure Local.
4+
author: alkohli
5+
ms.topic: how-to
6+
ms.date: 11/18/2024
7+
ms.author: alkohli
8+
ms.service: azure-stack-hci
9+
---
10+
11+
# Download managed data disks to Azure Local
12+
13+
[!INCLUDE [applies-to](../includes/hci-applies-to-23h2.md)]
14+
15+
This article describes how to download an Azure managed disk from Azure to your Azure Local instance. You can then use the disk to create an image or to attach it to your Arc virtual machines (VMs) as needed.
16+
17+
## Prerequisites
18+
19+
Before you begin, make sure to complete the following prerequisites:
20+
21+
- You have access to an Azure Local instance that is deployed and registered.
22+
- There is already a managed disk in Azure.
23+
24+
25+
## Download an Azure managed disk
26+
27+
Download an Azure managed disk as follows:
28+
29+
1. Set parameters for `subscription`, `resource-group`, `name`, and `custom-location`. Replace the parameters in `< >` with the appropriate values:
30+
31+
```azurecli
32+
$subscription = "<Subscription ID>"
33+
$resource-group = "<Resource group>"
34+
$name = "<Data disk name>"
35+
$custom-location = "<Custom location resource ID>"
36+
```
37+
38+
1. Generate a SAS URL of the disk using Azure CLI:
39+
40+
```azurecli
41+
az disk grant-access --access-level Read --duration-in-seconds 3600 --name $name --resource-group $resource-group
42+
```
43+
44+
1. Once the SAS URL is generated, use the following command to download it to your Azure Local:
45+
46+
```azurecli
47+
az stack-hci-vm disk create -resource-group $resource-group --disk-file-format vhd --custom-location $custom-location --download-url $download-url --name $name
48+
```
49+
50+
The parameters are described in the following table:
51+
52+
| Parameter | Description |
53+
| --- | --- |
54+
| `subscription` | Subscription associated with your Azure Local.
55+
| `resource-group` | Resource group for Azure Local that you associate with this image. |
56+
| `name` | Name of the data disk for Azure Local. |
57+
| `custom-location` | Resource ID of the custom location for Azure Local. |
58+
| `disk-file-format` | File format of the data disk. This can be `vhd` or `vhdx`. |
59+
| `download-url` | SAS URL of the Azure managed disk.|
60+
61+
Here is an example output:
62+
63+
```azurecli
64+
Download Uri for VHD is: https://*****
65+
{
66+
  "extendedLocation": {
67+
    "name": "/subscriptions/resourceGroups/providers/Microsoft.ExtendedLocation/customLocations/",
68+
    "type": "CustomLocation"
69+
  },
70+
  "id": "/subscriptions/resourceGroups/providers/Microsoft.AzureStackHCI/virtualHardDisks/httpvhd02",
71+
  "location": "eastus2euap",
72+
  "name": "httpvhd02",
73+
  "properties": {
74+
    "blockSizeBytes": null,
75+
    "containerId": "/subscriptions/resourceGroups/providers/Microsoft.AzureStackHCI/storageContainers/UserStorage",
76+
    "diskFileFormat": "vhd",
77+
    "diskSizeGb": null,
78+
    "downloadUrl": null,
79+
    "dynamic": null,
80+
    "hyperVGeneration": null,
81+
    "logicalSectorBytes": null,
82+
    "physicalSectorBytes": null,
83+
    "provisioningState": "Succeeded",
84+
    "status": {
85+
      "downloadStatus": null,
86+
      "errorCode": "",
87+
      "errorMessage": "",
88+
      "provisioningStatus": null,
89+
      "uploadStatus": null
90+
    }
91+
  },
92+
  "resourceGroup": "myresourcegroup",
93+
  "systemData": {
94+
    "createdAt": "2024-09-25T20:41:27.685358+00:00",
95+
    "createdBy": "mycreatedby",
96+
    "createdByType": "Application",
97+
    "lastModifiedAt": "2024-09-25T20:41:41.082674+00:00",
98+
    "lastModifiedBy": "mylastmodifiedby",
99+
    "lastModifiedByType": "Application"
100+
  },
101+
  "tags": null,
102+
  "
103+
```
104+
105+
## Next steps
106+
107+
[Create Azure Local VM image using images in a local share](virtual-machine-image-local-share.md)

0 commit comments

Comments
 (0)