Skip to content

Commit 38fb264

Browse files
committed
refresh
1 parent 1c69f29 commit 38fb264

12 files changed

+105
-49
lines changed
Lines changed: 101 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,89 @@
11
---
22
title: Configure a shared image gallery
3-
description: Learn how to configure a shared image gallery in Azure DevTest Labs, which enables users to access images from a shared location while creating lab resources.
3+
titleSuffix: Azure DevTest Labs
4+
description: Learn how to configure a shared image gallery in Azure DevTest Labs, so users can access virtual machine images from a shared location.
45
ms.topic: how-to
56
ms.custom: devx-track-arm-template, UpdateFrequency2
67
ms.author: rosemalcolm
78
author: RoseHJM
8-
ms.date: 06/26/2020
9+
ms.date: 06/05/2024
10+
11+
#customer intent: As a developer, I want to configure a shared image gallery in Azure DevTest Labs, so I can access images from a shared location to create lab machines.
912
---
1013

1114
# Configure a shared image gallery in Azure DevTest Labs
12-
DevTest Labs now supports the [Shared Image Gallery](../virtual-machines/shared-image-galleries.md) feature. It enables lab users to access images from a shared location while creating lab resources. It also helps you build structure and organization around your custom-managed VM images. The Shared Image Gallery feature supports:
1315

14-
- Managed global replication of images
15-
- Versioning and grouping of images for easier management
16-
- Make your images highly available with Zone Redundant Storage (ZRS) accounts in regions that support availability zones. ZRS offers better resilience against zonal failures.
17-
- Sharing across subscriptions, and even between tenants, using Azure role-based access control (Azure RBAC).
16+
DevTest Labs supports storing and sharing images with [Azure Compute Gallery](../virtual-machines/shared-image-galleries.md). A shared image gallery makes it easy to maintain a large number of managed images and make them widely available. It's also a great way to provide standardized images with current software for your users. Both specialized and generalized images are supported. By using a shared image gallery, you can build structure and organization around your custom-managed virtual machine (VM) images.
17+
18+
This article describes how to attach a shared image gallery to your lab. Users can access images from the shared location when creating lab VMs. A key advantage of this approach is that DevTest Labs lets you share VM images across labs, across subscriptions, and across regions.
19+
20+
## Explore shared image galleries
21+
22+
Some of the benefits of using a shared image gallery include:
1823

19-
For more information, see [Shared Image Gallery documentation](../virtual-machines/shared-image-galleries.md).
24+
- Manage global replication of images
25+
- Apply versioning and grouping for images to enable easier management
26+
- Access highly available images with Zone Redundant Storage (ZRS) accounts in regions that support availability zones for better resilience against zonal failures
27+
- Share images across subscriptions and between tenants by using role-based access control (RBAC)
2028

21-
If you have a large number of managed images that you need to maintain and would like to make them available throughout your company, you can use a shared image gallery as a repository that makes it easy to update and share your images. As a lab owner, you can attach an existing shared image gallery to your lab. Once this gallery is attached, lab users can create machines from these latest images. A key benefit of this feature is that DevTest Labs can now take the advantage of sharing images across labs, across subscriptions, and across regions.
29+
There are some considerations to keep in mind when working with a shared gallery:
30+
31+
- You can attach only one shared image gallery to your lab at a time. To attach a different gallery, first detach the current gallery.
32+
- You can only select images from an attached gallery through DevTest Labs. You can't upload images or change the images in the gallery through DevTest Labs.
33+
- When you create a VM from a shared image, DevTest Labs uses the latest published version of the image in the attached gallery. If an image has multiple versions, you can choose an earlier version on the **Advanced Settings** tab during VM creation.
34+
- DevTest Labs attempts to replicate all images in the attached gallery to the lab region. Sometimes, replication isn't possible. To avoid users having issues when creating VMs from images, ensure the images in the attached gallery fully replicate to the lab region.
35+
36+
To learn about costs associated with using a shared image gallery, see [Billing for Azure Compute Gallery](../virtual-machines/azure-compute-gallery.md#billing).
37+
38+
## Attach gallery from the Azure portal
39+
40+
Follow these steps to attach a shared image gallery to your DevTest Labs resource:
41+
42+
1. In the [Azure portal](https://portal.azure.com), go to your DevTest Labs resource where you want to attach the shared image gallery.
43+
44+
1. On your lab **Overview** page, expand the **Settings** section in the left menu, and select **Configuration and policies**.
45+
46+
1. On the **Configuration and policies** screen, expand the **Virtual machine bases** section in the left menu, and select **Shared Image Galleries**:
47+
48+
:::image type="content" source="./media/configure-shared-image-gallery/galleries-attach.png" border="false" alt-text="Screenshot that shows how to select the Attach option for shared image galleries for a DevTest Labs resource." lightbox="./media/configure-shared-image-gallery/galleries-attach-large.png":::
49+
50+
1. Select **Attach** to add an existing shared image gallery to your lab.
51+
52+
1. In the **Attach gallery** dropdown list, select the shared image gallery to add to your lab, and then select **OK**:
53+
54+
:::image type="content" source="./media/configure-shared-image-gallery/attach-gallery.png" border="false" alt-text="Screenshot that shows how to attach a shared image gallery to a lab.":::
2255

23-
> [!NOTE]
24-
> To learn about costs associated with the Shared Image Gallery service, see [Billing for Azure Compute Gallery](../virtual-machines/azure-compute-gallery.md#billing).
56+
1. After DevTest Labs attaches the gallery to your lab, you can select the gallery name to see the full list of images:
2557

26-
## Considerations
27-
- You can only attach one shared image gallery to a lab at a time. If you would like to attach another gallery, you'll need to detach the existing one and attach another.
28-
- DevTest Labs currently doesn't support uploading images to the gallery through the lab.
29-
- When you create a virtual machine using a shared image gallery image, DevTest Labs always uses the latest published version of this image. However if an image has multiple versions, users can choose to create a machine from an earlier version by going to the Advanced settings tab during virtual machine creation.
30-
- Although DevTest Labs automatically makes a best attempt to ensure shared image gallery replicates images to the region in which the Lab exists, it’s not always possible. To avoid users having issues creating VMs from these images, ensure the images are already replicated to the lab’s region.”
58+
:::image type="content" source="./media/configure-shared-image-gallery/view-allowed-images.png" alt-text="Screenshot that shows the list of images in the shared gallery with indicators to show the allowed images for VM creation.":::
3159

32-
## Use Azure portal
33-
1. Sign in to the [Azure portal](https://portal.azure.com).
34-
1. Select **All Services** on the left navigational menu.
35-
1. Select **DevTest Labs** from the list.
36-
1. From the list of labs, select your **lab**.
37-
1. Select **Configuration and policies** in the **Settings** section on the left menu.
38-
1. Select **Shared Image Galleries** under **Virtual machine bases** on the left menu.
60+
## Control available images
3961

40-
![Shared Image Galleries menu](./media/configure-shared-image-gallery/shared-image-galleries-menu.png)
41-
1. Attach an existing shared image gallery to your lab by clicking on the **Attach** button and selecting your gallery in the dropdown.
62+
The **Allow all images to be used as virtual machine bases** option lets you control which images are available for lab users to use when creating lab VMs. By default, this option is set to **Yes**, and lab users have access to all images in the attached gallery.
63+
64+
Follow these steps to restrict access for images in the gallery:
65+
66+
1. On the **Configuration and policies** page for your lab, go to the **Virtual machine bases** > **Shared Image Galleries** screen.
4267

43-
![Attach](./media/configure-shared-image-gallery/attach-options.png)
44-
1. After the image gallery is attached, select it to go to the attached gallery. Configure your gallery to **enable or disable** shared images for VM creation. Select an image gallery from the list to configure it.
68+
1. Select the attached gallery name to open the **Shared images** page, which shows the list of images.
4569

46-
By default, **Allow all images to be used as virtual machine bases** is set to **Yes**. It means that all images available in the attached shared image gallery will be available to a lab user when creating a new lab VM. If access to certain images needs to be restricted, change **Allow all images to be used as virtual machine bases** to **No**, and select the images that you want to allow when creating VMs, and then select the **Save** button.
70+
1. On the **Shared images** page, set the **Allow all images to be used as virtual machine bases** option to **No**.
71+
72+
1. For any image that you want to make _unavailable_ to lab users, deselect the checkbox for the image.
73+
74+
1. Select **Save**.
4775

48-
:::image type="content" source="./media/configure-shared-image-gallery/enable-disable.png" alt-text="Enable or disable images":::
76+
## Access images in attached gallery
4977

50-
> [!NOTE]
51-
> Both generalized and specialized images in the shared image gallery are supported.
52-
1. Lab users can then create a virtual machine using the enabled images by clicking on **+Add** and finding the image in the **choose your base** page.
78+
After you attach a shared image gallery to your lab, lab users can choose from the allowed images when they create a new VM.
5379

54-
![Lab users](./media/configure-shared-image-gallery/lab-users.png)
55-
## Use Azure Resource Manager template
80+
The gallery images are included in the list of available options in the **Choose your base** page during the VM creation process:
5681

57-
### Attach a shared image gallery to your lab
58-
If you're using an Azure Resource Manager template to attach a shared image gallery to your lab, you need to add it under the resources section of your Resource Manager template, as shown in the following example:
82+
:::image type="content" source="./media/configure-shared-image-gallery/lab-users.png" alt-text="Screenshot that shows the list of available images for the VM instance, including the allowed images from the attached gallery.":::
83+
84+
## Attach gallery by using template
85+
86+
You can use an Azure Resource Manager (ARM) template to attach a shared image gallery to your lab. You need to add the gallery as a resource for your ARM template, as shown in the following example:
5987

6088
```json
6189
"resources": [
@@ -78,24 +106,46 @@ If you're using an Azure Resource Manager template to attach a shared image gall
78106
}
79107
```
80108

81-
For a complete Resource Manager template example, see these Resource Manager template samples in our public GitHub repository: [Configure a shared image gallery while creating a lab](https://github.com/Azure/azure-devtestlab/tree/master/samples/DevTestLabs/QuickStartTemplates/101-dtl-create-lab-shared-gallery-configured).
109+
The DevTest Labs GitHub repository provides full samples that use ARM templates to attach shared image galleries. To get started, you can [Configure a shared image gallery when you create a new lab](https://github.com/Azure/azure-devtestlab/tree/master/samples/DevTestLabs/QuickStartTemplates/101-dtl-create-lab-shared-gallery-configured).
82110

83111
## Use REST API
84112

85-
### Get a list of labs
113+
The following sections provide examples for how to use the REST API to work with images from the shared image gallery.
114+
115+
### Get list of labs
116+
117+
The following GET call returns the list of DevTest Labs resources for a subscription. In this example, you provide the following parameters:
118+
119+
- `subscriptionId`: The subscription ID for which to return the list of DevTest Labs resources.
120+
- `resourceGroupName`: The name of the resource group to search for DevTest Labs resources.
86121

87122
```rest
88123
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs?api-version= 2018-10-15-preview
89124
```
90125

91-
### Get the list of shared image galleries associated with a lab
126+
### Get list of shared image galleries for lab
127+
128+
The following GET call returns the list of shared image galleries associated with a lab. In this example, you provide the following parameters:
129+
130+
- `subscriptionId`: The subscription ID for the DevTest Labs resource.
131+
- `resourceGroupName`: The name of the resource group for the DevTest Labs resource.
132+
- `labName`: The name of the DevTest Labs resource for which to to return the list of associated shared image galleries.
92133

93134
```rest
94135
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/sharedgalleries?api-version= 2018-10-15-preview
95-
```
136+
```
96137

97138
### Create or update shared image gallery
98139

140+
The following PUT call creates or updates a shared image gallery for a specified lab. In this example, you provide the following parameters:
141+
142+
- `subscriptionId`: The subscription ID for the DevTest Labs resource.
143+
- `resourceGroupName`: The name of the resource group for the DevTest Labs resource.
144+
- `labName`: The name of the DevTest Labs resource.
145+
- `name`: The name of the shared gallery to create or update for the lab.
146+
- `galleryId`: The ID of the shared gallery to create or update for the lab.
147+
- `allowAllImages`: Set to `Enabled` to allow all images in the gallery to be used with the lab resource.
148+
99149
```rest
100150
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/sharedgalleries/{name}?api-version=2018-10-15-preview
101151
Body:
@@ -105,16 +155,22 @@ Body:
105155
"allowAllImages": "Enabled"
106156
}
107157
}
108-
109158
```
110159

111-
### List images in a shared image gallery
160+
### List images in shared image gallery
161+
162+
The following GET call returns the list of images in a specified shared image gallery for a lab. In this example, you provide the following parameters:
163+
164+
- `subscriptionId`: The subscription ID for the DevTest Labs resource.
165+
- `resourceGroupName`: The name of the resource group for the DevTest Labs resource.
166+
- `labName`: The name of the DevTest Labs resource.
167+
- `name`: The name of the shared gallery associated with the lab for which you want to list the images.
112168

113169
```rest
114170
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/sharedgalleries/{name}/sharedimages?api-version=2018-10-15-preview
115171
```
116172

173+
## Related content
117174

118-
119-
## Next steps
120-
See the following articles on creating a VM using an image from the attached shared image gallery: [Create a VM using a shared image from the gallery](add-vm-use-shared-image.md)
175+
- [Create VM from image in attached shared image gallery](add-vm-use-shared-image.md)
176+
- Explore [Azure Compute Gallery documentation](../virtual-machines/shared-image-galleries.md)

articles/devtest-labs/devtest-lab-add-claimable-vm.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ A claimable VM is added to a lab in a similar manner to how you [add a standard
2121

2222
Use the following steps to add a claimable VM to a lab in DevTest Labs:
2323

24-
1. In the [Azure portal](https://go.microsoft.com/fwlink/p/?LinkID=525040), go to your DevTest Labs lab resource where you want to create the claimable VM.
24+
1. In the [Azure portal](https://portal.azure.com), go to your DevTest Labs lab resource where you want to create the claimable VM.
2525

2626
1. On the lab **Overview** page, select **Add** to create a new virtual machine:
2727

@@ -143,4 +143,4 @@ When a VM is claimed by a user, the attached data disk is added to the new user'
143143

144144
## Related content
145145

146-
- Explore the [DevTest Labs Azure Resource Manager quickStart template gallery](https://github.com/Azure/azure-devtestlab/tree/master/samples/DevTestLabs/QuickStartTemplates)
146+
- Explore the [DevTest Labs ARM template QuickStart gallery](https://github.com/Azure/azure-devtestlab/tree/master/samples/DevTestLabs/QuickStartTemplates)

articles/devtest-labs/devtest-lab-configure-cost-management.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ After DevTest Labs is configured to provide the lab-specific information for Mic
6565

6666
For a quick view of costs per lab, following these steps:
6767

68-
1. In the [Azure portal](https://go.microsoft.com/fwlink/p/?LinkID=525040), go to your lab, and select a resource group that has tags.
68+
1. In the [Azure portal](https://portal.azure.com), go to your lab, and select a resource group that has tags.
6969

7070
1. On the left menu, expand **Cost Management**, and select **Cost analysis**.
7171

articles/devtest-labs/devtest-lab-mandatory-artifacts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ When you create a VM, you can't rearrange, change, or delete the mandatory artif
2727

2828
You can select mandatory artifacts for Windows and Linux lab machines separately by following these steps:
2929

30-
1. In the [Azure portal](https://go.microsoft.com/fwlink/p/?LinkID=525040), go to your DevTest Labs lab resource where you want to define the mandatory artifacts.
30+
1. In the [Azure portal](https://portal.azure.com), go to your DevTest Labs lab resource where you want to define the mandatory artifacts.
3131

3232
1. On your lab **Overview** page, expand the **Settings** section in the left menu, and select **Configuration and policies**.
3333

29.8 KB
Loading
Binary file not shown.
Binary file not shown.
140 KB
Loading
134 KB
Loading
-14.5 KB
Loading

0 commit comments

Comments
 (0)