Skip to content

Commit 08dc52d

Browse files
committed
Consolidating managed image stuff
1 parent 807a1b9 commit 08dc52d

File tree

4 files changed

+68
-96
lines changed

4 files changed

+68
-96
lines changed

articles/virtual-machines/.openpublishing.redirection.virtual-machines.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4889,6 +4889,21 @@
48894889
"redirect_url": "/previous-versions/azure/virtual-machines/tag-template",
48904890
"redirect_document_id": false
48914891
},
4892+
{
4893+
"source_path_from_root": "/articles/virtual-machines/windows/create-vm-generalized-managed.md",
4894+
"redirect_url": "/azure/virtual-machines/vm-generalized-image-version",
4895+
"redirect_document_id": true
4896+
},
4897+
{
4898+
"source_path_from_root": "/articles/virtual-machines/windows/upload-generalized-managed.md",
4899+
"redirect_url": "/azure/virtual-machines/windows/disks-upload-vhd-to-managed-disk-powershell",
4900+
"redirect_document_id": true
4901+
},
4902+
{
4903+
"source_path_from_root": "/articles/virtual-machines/windows/capture-image-resource.md",
4904+
"redirect_url": "/azure/virtual-machines/capture-image-resource",
4905+
"redirect_document_id": true
4906+
},
48924907
{
48934908
"source_path_from_root": "/articles/virtual-machines/workloads/sap/baremetal-infrastructure-portal.md",
48944909
"redirect_url": "/azure/baremetal-infrastructure/connect-baremetal-infrastructure",

articles/virtual-machines/windows/capture-image-resource.md

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
11
---
22
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.
44
author: cynthn
55
ms.service: virtual-machines
66
ms.subservice: imaging
77
ms.workload: infrastructure-services
88
ms.topic: how-to
9-
ms.date: 02/24/2022
9+
ms.date: 02/28/2023
1010
ms.author: cynthn
1111
ms.custom: legacy
12-
ms.collection: windows
1312

1413
---
1514
# Create a managed image of a generalized VM in Azure
1615

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
1817

1918

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).
2120

2221
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.
2322

23+
For information on how managed images are billed, see [Managed Disks pricing](https://azure.microsoft.com/pricing/details/managed-disks/).
24+
2425
## Prerequisites
2526

2627
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
201202
$image = New-AzImage -ImageName $imageName -ResourceGroupName $rgName -Image $imageConfig
202203
```
203204
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+
204245

205246
## Next steps
206247
- [Create a VM from a managed image](create-vm-generalized-managed.md).

articles/virtual-machines/windows/create-vm-generalized-managed.md

Lines changed: 0 additions & 60 deletions
This file was deleted.

articles/virtual-machines/windows/upload-generalized-managed.md

Lines changed: 7 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,27 @@
11
---
2-
title: Create a VM from an uploaded generalized Windows VHD
3-
description: Upload a generalized Windows VHD to Azure and use it to create new VMs, in the Resource Manager deployment model.
2+
title: Upload a VHD to Azure
3+
description: Upload a VHD to Azure to use as a basis for images for creating new virtual machines.
44
author: cynthn
55
ms.service: virtual-machines
66
ms.subservice: imaging
77
ms.workload: infrastructure-services
88
ms.topic: how-to
9-
ms.date: 12/12/2019
9+
ms.date: 02/28/2023
1010
ms.author: cynthn
1111
ms.custom: devx-track-azurepowershell
1212
---
1313

14-
# Upload a generalized Windows VHD and use it to create new VMs in Azure
14+
# Upload a VHD
1515

1616
**Applies to:** :heavy_check_mark: Windows VMs :heavy_check_mark: Flexible scale sets
1717

18-
This article walks you through using PowerShell to upload a VHD of a generalized VM to Azure, create an image from the VHD, and create a new VM from that image. You can upload a VHD exported from an on-premises virtualization tool or from another cloud. Using [Managed Disks](../managed-disks-overview.md) for the new VM simplifies the VM management and provides better availability when the VM is placed in an availability set.
18+
This article walks you through using PowerShell to upload a VHD of a generalized VM to Azure. You can upload a VHD exported from an on-premises virtualization tool or from another cloud. Uploading to a managed disk simplifies the eventual creation of a [image](image-version.md) you can use to create multiple VMs.
1919

20-
For a sample script, see [Sample script to upload a VHD to Azure and create a new VM](/previous-versions/azure/virtual-machines/scripts/virtual-machines-windows-powershell-upload-generalized-script).
2120

2221
## Before you begin
2322

24-
- Before uploading any VHD to Azure, you should follow [Prepare a Windows VHD or VHDX to upload to Azure](prepare-for-upload-vhd-image.md).
25-
- Review [Plan for the migration to Managed Disks](on-prem-to-azure.md#plan-for-the-migration-to-managed-disks) before starting your migration to [Managed Disks](../managed-disks-overview.md).
26-
27-
28-
## Generalize the source VM by using Sysprep
29-
30-
If you haven't already, you need to Sysprep the VM before uploading the VHD to Azure. Sysprep removes all your personal account information, among other things, and prepares the machine to be used as an image. For details about Sysprep, see the [Sysprep Overview](/windows-hardware/manufacture/desktop/sysprep--system-preparation--overview).
31-
32-
Make sure the server roles running on the machine are supported by Sysprep. For more information, see [Sysprep Support for Server Roles](/windows-hardware/manufacture/desktop/sysprep-support-for-server-roles).
33-
34-
> [!IMPORTANT]
35-
> If you plan to run Sysprep before uploading your VHD to Azure for the first time, make sure you have [prepared your VM](prepare-for-upload-vhd-image.md).
36-
>
37-
>
38-
39-
1. Sign in to the Windows virtual machine.
40-
1. Open the Command Prompt window as an administrator.
41-
1. Delete the panther directory (C:\Windows\Panther).
42-
1. Change the directory to %windir%\system32\sysprep, and then run `sysprep.exe`.
43-
1. In the **System Preparation Tool** dialog box, select **Enter System Out-of-Box Experience (OOBE)**, and make sure that the **Generalize** check box is enabled.
44-
1. For **Shutdown Options**, select **Shutdown**.
45-
1. Select **OK**.
46-
47-
![Start Sysprep](./media/upload-generalized-managed/sysprepgeneral.png)
48-
1. When Sysprep finishes, it shuts down the virtual machine. Do not restart the VM.
23+
- Before uploading a Linux VHD to Azure, review [Bringing and creating Linux images in Azure](./linux/imaging.md)
24+
- Before uploading a Windows VHD to Azure, you should follow [Prepare a Windows VHD or VHDX to upload to Azure](prepare-for-upload-vhd-image.md).
4925

5026

5127
## Upload the VHD

0 commit comments

Comments
 (0)