You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
#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.
9
12
---
10
13
11
14
# 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:
13
15
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:
18
23
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)
20
28
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.":::
22
55
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:
25
57
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.":::
31
59
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.
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.
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.
45
69
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**.
47
75
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
49
77
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.
The gallery images are included in the list of available options in the **Choose your base** page during the VM creation process:
56
81
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:
59
87
60
88
```json
61
89
"resources": [
@@ -78,24 +106,46 @@ If you're using an Azure Resource Manager template to attach a shared image gall
78
106
}
79
107
```
80
108
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).
82
110
83
111
## Use REST API
84
112
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.
86
121
87
122
```rest
88
123
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs?api-version= 2018-10-15-preview
89
124
```
90
125
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.
92
133
93
134
```rest
94
135
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/sharedgalleries?api-version= 2018-10-15-preview
95
-
```
136
+
```
96
137
97
138
### Create or update shared image gallery
98
139
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
+
99
149
```rest
100
150
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/sharedgalleries/{name}?api-version=2018-10-15-preview
101
151
Body:
@@ -105,16 +155,22 @@ Body:
105
155
"allowAllImages": "Enabled"
106
156
}
107
157
}
108
-
109
158
```
110
159
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.
112
168
113
169
```rest
114
170
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/sharedgalleries/{name}/sharedimages?api-version=2018-10-15-preview
115
171
```
116
172
173
+
## Related content
117
174
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)
Copy file name to clipboardExpand all lines: articles/devtest-labs/devtest-lab-add-claimable-vm.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ A claimable VM is added to a lab in a similar manner to how you [add a standard
21
21
22
22
Use the following steps to add a claimable VM to a lab in DevTest Labs:
23
23
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.
25
25
26
26
1. On the lab **Overview** page, select **Add** to create a new virtual machine:
27
27
@@ -143,4 +143,4 @@ When a VM is claimed by a user, the attached data disk is added to the new user'
- Explore the [DevTest Labs ARM template QuickStart gallery](https://github.com/Azure/azure-devtestlab/tree/master/samples/DevTestLabs/QuickStartTemplates)
Copy file name to clipboardExpand all lines: articles/devtest-labs/devtest-lab-mandatory-artifacts.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ When you create a VM, you can't rearrange, change, or delete the mandatory artif
27
27
28
28
You can select mandatory artifacts for Windows and Linux lab machines separately by following these steps:
29
29
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.
31
31
32
32
1. On your lab **Overview** page, expand the **Settings** section in the left menu, and select **Configuration and policies**.
0 commit comments