|
1 | 1 | ---
|
2 | 2 | title: Create a managed image in Azure
|
3 |
| -description: Create a managed image of a generalized VM or VHD in Azure. Images can be used to create multiple VMs that use managed disks. |
| 3 | +description: Create a legacy managed image of a generalized VM or VHD in Azure. |
4 | 4 | author: cynthn
|
5 | 5 | ms.service: virtual-machines
|
6 | 6 | ms.subservice: imaging
|
7 | 7 | ms.workload: infrastructure-services
|
8 | 8 | ms.topic: how-to
|
9 |
| -ms.date: 02/24/2022 |
| 9 | +ms.date: 02/28/2023 |
10 | 10 | ms.author: cynthn
|
11 | 11 | ms.custom: legacy
|
12 |
| -ms.collection: windows |
13 | 12 |
|
14 | 13 | ---
|
15 | 14 | # Create a managed image of a generalized VM in Azure
|
16 | 15 |
|
17 |
| -**Applies to:** :heavy_check_mark: Windows VMs |
| 16 | +**Applies to:** :heavy_check_mark: Linux VMs :heavy_check_mark: Windows VMs :heavy_check_mark: Flexible scale sets |
18 | 17 |
|
19 | 18 |
|
20 |
| -Managed images are helpful in development and test environments where you need a consistent baseline VM. A managed image resource can be created from a generalized virtual machine (VM) that is stored as either a managed disk or an unmanaged disk in a storage account. The image can then be used to create multiple VMs. For information on how managed images are billed, see [Managed Disks pricing](https://azure.microsoft.com/pricing/details/managed-disks/). |
| 19 | +This article covers the older managed image technology. For the most current technology, customers are encouraged to use [Azure Compute Gallery](azure-compute-gallery.md). All new features, like ARM64, Trusted Launch, and Confidential VM are only supported through Azure Compute Gallery. If you have an existing managed image, you can use it as a source and create an Azure Compute Gallery image. For more information, see [Create an image definition and image version](image-version.md). |
21 | 20 |
|
22 | 21 | One managed image supports up to 20 simultaneous deployments. Attempting to create more than 20 VMs concurrently, from the same managed image, may result in provisioning timeouts due to the storage performance limitations of a single VHD. To create more than 20 VMs concurrently, use an [Azure Compute Gallery](../shared-image-galleries.md) (formerly known as Shared Image Gallery) image configured with 1 replica for every 20 concurrent VM deployments.
|
23 | 22 |
|
| 23 | +For information on how managed images are billed, see [Managed Disks pricing](https://azure.microsoft.com/pricing/details/managed-disks/). |
| 24 | + |
24 | 25 | ## Prerequisites
|
25 | 26 |
|
26 | 27 | You need a [generalized](../generalize.md) VM in order to create an image.
|
@@ -201,6 +202,46 @@ To create a managed image from a VM that doesn't use managed disks, you need the
|
201 | 202 | $image = New-AzImage -ImageName $imageName -ResourceGroupName $rgName -Image $imageConfig
|
202 | 203 | ```
|
203 | 204 |
|
| 205 | +
|
| 206 | +## Create a VM from a managed image |
| 207 | +
|
| 208 | +One managed image supports up to 20 simultaneous deployments. Attempting to create more than 20 VMs concurrently, from the same managed image, may result in provisioning timeouts due to the storage performance limitations of a single VHD. To create more than 20 VMs concurrently, use an [Azure Compute Gallery](../shared-image-galleries.md) (formerly known as Shared Image Gallery) image configured with 1 replica for every 20 concurrent VM deployments. |
| 209 | +
|
| 210 | +### Portal |
| 211 | +
|
| 212 | +1. Go to the [Azure portal](https://portal.azure.com) to find a managed image. Search for and select **Images**. |
| 213 | +3. Select the image you want to use from the list. The image **Overview** page opens. |
| 214 | +4. Select **Create VM** from the menu. |
| 215 | +5. Enter the virtual machine information. The user name and password entered here will be used to log in to the virtual machine. When complete, select **OK**. You can create the new VM in an existing resource group, or choose **Create new** to create a new resource group to store the VM. |
| 216 | +6. Select a size for the VM. To see more sizes, select **View all** or change the **Supported disk type** filter. |
| 217 | +7. Under **Settings**, make changes as necessary and select **OK**. |
| 218 | +8. On the summary page, you should see your image name listed as a **Private image**. Select **Ok** to start the virtual machine deployment. |
| 219 | +
|
| 220 | +
|
| 221 | +### PowerShell |
| 222 | +
|
| 223 | +You can use PowerShell to create a VM from an image by using the simplified parameter set for the [New-AzVm](/powershell/module/az.compute/new-azvm) cmdlet. The image needs to be in the same resource group where you'll create the VM. |
| 224 | +
|
| 225 | + |
| 226 | +
|
| 227 | +The simplified parameter set for [New-AzVm](/powershell/module/az.compute/new-azvm) only requires that you provide a name, resource group, and image name to create a VM from an image. New-AzVm will use the value of the **-Name** parameter as the name of all of the resources that it creates automatically. In this example, we provide more detailed names for each of the resources but let the cmdlet create them automatically. You can also create resources beforehand, such as the virtual network, and pass the resource name into the cmdlet. New-AzVm will use the existing resources if it can find them by their name. |
| 228 | +
|
| 229 | +The following example creates a VM named *myVMFromImage*, in the *myResourceGroup* resource group, from the image named *myImage*. |
| 230 | +
|
| 231 | +
|
| 232 | +```azurepowershell-interactive |
| 233 | +New-AzVm ` |
| 234 | + -ResourceGroupName "myResourceGroup" ` |
| 235 | + -Name "myVMfromImage" ` |
| 236 | + -ImageName "myImage" ` |
| 237 | + -Location "East US" ` |
| 238 | + -VirtualNetworkName "myImageVnet" ` |
| 239 | + -SubnetName "myImageSubnet" ` |
| 240 | + -SecurityGroupName "myImageNSG" ` |
| 241 | + -PublicIpAddressName "myImagePIP" |
| 242 | +``` |
| 243 | + |
| 244 | + |
204 | 245 |
|
205 | 246 | ## Next steps
|
206 | 247 | - [Create a VM from a managed image](create-vm-generalized-managed.md).
|
|
0 commit comments