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
Create a new VM by attaching an existing OS disk to a new VM. This option is useful if you have a VM that isn't working correctly. You can delete the VM and then reuse the disk to create a new VM.
18
18
19
-
20
-
You can also use the Azure portal to [create a new VM from an existing disk](create-vm-specialized-portal.md).
21
-
22
-
23
19
> [!IMPORTANT]
24
-
>
20
+
>
25
21
> Creating an image instead of just attaching a disk means you can create multiple VMs from the same source disk.
26
22
> When you use a specialized disk to create a new VM, the new VM retains the computer name of the original VM. Other computer-specific information (e.g. CMID) is also kept and, in some cases, this duplicate information could cause issues. When copying a VM, be aware of what types of computer-specific information your applications rely on.
27
23
>
28
24
> You can also use the VHD as a source to create an Azure Compute Gallery image. For more information, see [Create an image definition and image version](../image-version.md). Customers are encouraged to use Azure Compute Gallery as all new features like ARM64, Trusted Launch, and Confidential VM,are only supported through Azure Compute Gallery.
29
25
30
26
We recommend that you limit the number of concurrent deployments to 20 VMs from a single VHD or snapshot.
31
-
## Get an existing disk
27
+
28
+
29
+
### [Portal](#tab/portal)
30
+
31
+
32
+
Create a snapshot and then create a disk from the snapshot. This strategy allows you to keep the original VHD as a fallback:
33
+
34
+
1. Open the [Azure portal](https://portal.azure.com).
35
+
2. In the search box, enter **disks** and then select **Disks** to display the list of available disks.
36
+
3. Select the disk that you would like to use. The **Disk** page for that disk appears.
37
+
4. From the menu at the top, select **Create snapshot**.
38
+
5. Choose a **Resource group** for the snapshot. You can use either an existing resource group or create a new one.
39
+
6. Enter a **Name** for the snapshot.
40
+
7. For **Snapshot type**, choose **Full**.
41
+
8. For **Storage type**, choose **Standard HDD**, **Premium SSD**, or **Zone-redundant** storage.
42
+
9. When you're done, select **Review + create** to create the snapshot.
43
+
10. After the snapshot has been created, select **Home** > **Create a resource**.
44
+
11. In the search box, enter **managed disk** and then select **Managed Disks** from the list.
45
+
12. On the **Managed Disks** page, select **Create**.
46
+
13. Choose a **Resource group** for the disk. You can use either an existing resource group or create a new one. This selection will also be used as the resource group where you create the VM from the disk.
47
+
14. For **Region**, you must select the same region where the snapshot is located.
48
+
15. Enter a **Name** for the disk.
49
+
16. In **Source type**, ensure **Snapshot** is selected.
50
+
17. In the **Source snapshot** drop-down, select the snapshot you want to use.
51
+
18. For **Size**, you can change the storage type and size as needed.
52
+
19. Make any other adjustments as needed and then select **Review + create** to create the disk. Once validation passes, select **Create**.
53
+
54
+
55
+
After you have the disk that you want to use, you can create the VM in the portal:
56
+
57
+
1. In the search box, enter **disks** and then select **Disks** to display the list of available disks.
58
+
3. Select the disk that you would like to use. The **Disk** page for that disk opens.
59
+
4. In the **Essentials** section, ensure that **Disk state** is listed as **Unattached**. If it isn't, you might need to either detach the disk from the VM or delete the VM to free up the disk.
60
+
4. In the menu at the top of the page, select **Create VM**.
61
+
5. On the **Basics** page for the new VM, enter a **Virtual machine name** and either select an existing **Resource group** or create a new one.
62
+
6. For **Size**, select **Change size** to access the **Size** page.
63
+
7. The disk name should be pre-filled in the **Image** section.
64
+
8. On the **Disks** page, you may notice that the **OS Disk Type** cannot be changed. This preselected value is configured at the point of Snapshot or VHD creation and will carry over to the new VM. If you need to modify disk type take a new snapshot from an existing VM or disk.
65
+
9. On the **Networking** page, you can either let the portal create all new resources or you can select an existing **Virtual network** and **Network security group**. The portal always creates a new network interface and public IP address for the new VM.
66
+
10. On the **Management** page, make any changes to the monitoring options.
67
+
11. On the **Guest config** page, add any extensions as needed.
68
+
12. When you're done, select **Review + create**.
69
+
13. If the VM configuration passes validation, select **Create** to start the deployment.
70
+
71
+
72
+
73
+
74
+
### [PowerShell](#tab/powershell)
75
+
32
76
33
77
If you had a VM that you deleted and you want to reuse the OS disk to create a new VM, use [Get-AzDisk](/powershell/module/az.compute/get-azdisk).
34
78
@@ -41,14 +85,6 @@ $osDisk = Get-AzDisk `
41
85
```
42
86
You can now attach this disk as the OS disk to a [new VM](#create-the-new-vm).
43
87
44
-
45
-
46
-
## Create the new VM
47
-
48
-
Create networking and other VM resources to be used by the new VM.
49
-
50
-
### Create the subnet and virtual network
51
-
52
88
Create the [virtual network](../../virtual-network/virtual-networks-overview.md) and subnet for the VM.
53
89
54
90
1. Create the subnet. This example creates a subnet named *mySubNet*, in the resource group *myDestinationResourceGroup*, and sets the subnet address prefix to *10.0.0.0/24*.
@@ -72,8 +108,7 @@ Create the [virtual network](../../virtual-network/virtual-networks-overview.md)
72
108
```
73
109
74
110
75
-
### Create the network security group and an RDP rule
76
-
To be able to sign in to your VM with remote desktop protocol (RDP), you'll need to have a security rule that allows RDP access on port 3389. In our example, the VHD for the new VM was created from an existing specialized VM, so you can use an account that existed on the source virtual machine for RDP. This example denies RDP traffic, to be more secure. You can change `-Access` to `Allow` if you want to allow RDP access.
111
+
To be able to sign in to your VM with remote desktop protocol (RDP), you'll need to have a security rule that allows RDP access on port 3389. In our example, the VHD for the new VM was created from an existing Windows specialized VM, so you can use an account that existed on the source virtual machine for RDP. This example denies RDP traffic, to be more secure. You can change `-Access` to `Allow` if you want to allow RDP access.
77
112
78
113
This example sets the network security group (NSG) name to *myNsg* and the RDP rule name to *myRdpRule*.
For more information about endpoints and NSG rules, see [Opening ports to a VM in Azure by using PowerShell](nsg-quickstart-powershell.md).
95
130
96
-
### Create a public IP address and NIC
97
131
To enable communication with the virtual machine in the virtual network, you'll need a [public IP address](../../virtual-network/ip-services/public-ip-addresses.md) and a network interface.
98
132
99
133
1. Create the public IP. In this example, the public IP address name is set to *myIP*.
@@ -119,33 +153,27 @@ To enable communication with the virtual machine in the virtual network, you'll
119
153
120
154
121
155
122
-
### Set the VM name and size
123
-
124
-
This example sets the VM name to *myVM* and the VM size to *Standard_A2*.
156
+
Set the VM name and size. This example sets the VM name to *myVM* and the VM size to *Standard_A2*.
Add the OS disk to the configuration by using [Set-AzVMOSDisk](/powershell/module/az.compute/set-azvmosdisk). This example sets the size of the disk to *128 GB* and attaches the disk as a *Windows* OS disk.
170
+
Add the OS disk. Add the OS disk to the configuration by using [Set-AzVMOSDisk](/powershell/module/az.compute/set-azvmosdisk). This example sets the size of the disk to *128 GB* and attaches the disk as a *Windows* OS disk.
You should see the newly created VM either in the [Azure portal](https://portal.azure.com) under **Browse** > **Virtual machines**, or by using the following PowerShell commands.
Sign in to your new virtual machine. For more information, see [How to connect and log on to an Azure virtual machine running Windows](connect-logon.md).
Copy file name to clipboardExpand all lines: articles/virtual-machines/create-vm-specialized-portal.md
+5-8Lines changed: 5 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,9 @@
1
1
---
2
-
title: Create a Windows VM from a specialized VHD in the Azure portal
3
-
description: Create a new Windows VM from a VHD in the Azure portal.
2
+
title: Create a VM from a specialized VHD in the Azure portal
3
+
description: Create a new VM by attaching a specialized disk in the Azure portal.
4
4
author: cynthn
5
5
ms.service: virtual-machines
6
-
ms.subservice: imaging
7
-
ms.collection: windows
6
+
ms.subservice:
8
7
ms.workload: infrastructure-services
9
8
ms.topic: how-to
10
9
ms.date: 03/30/2023
@@ -25,9 +24,7 @@ ms.author: cynthn
25
24
26
25
27
26
28
-
If you already have a virtual hard disk (VHD) to use or you want to copy the VHD from an existing VM to use, you can create a new VM by *attaching* the VHD to the new VM as an OS disk.
29
-
30
-
You can also create a new VM from the VHD of a VM that has been deleted. For example, if you have an Azure VM that isn't working correctly, you can delete the VM and use its VHD to create a new VM.
27
+
If you already have a virtual hard disk (VHD) to use, you can create a new VM by *attaching* the VHD to the new VM as an OS disk. This is useful when you want to create a new VM from the VHD of a VM that has been deleted. For example, if you have an Azure VM that isn't working correctly, you can delete the VM and use its VHD to create a new VM.
31
28
32
29
We recommend that you limit the number of concurrent deployments to 20 VMs from a single snapshot or VHD.
33
30
@@ -66,7 +63,7 @@ After you have the disk that you want to use, you can create the VM in the porta
66
63
5. On the **Basics** page for the new VM, enter a **Virtual machine name** and either select an existing **Resource group** or create a new one.
67
64
6. For **Size**, select **Change size** to access the **Size** page.
68
65
7. The disk name should be pre-filled in the **Image** section.
69
-
8. On the **Disks** page, you may notice that the "OS Disk Type" cannot be changed. This preselected value is configured at the point of Snapshot or VHD creation and will carry over to the new VM. If you need to modify disk type take a new snapshot from an existing VM or disk.
66
+
8. On the **Disks** page, you may notice that the **OS Disk Type** cannot be changed. This preselected value is configured at the point of Snapshot or VHD creation and will carry over to the new VM. If you need to modify disk type take a new snapshot from an existing VM or disk.
70
67
9. On the **Networking** page, you can either let the portal create all new resources or you can select an existing **Virtual network** and **Network security group**. The portal always creates a new network interface and public IP address for the new VM.
71
68
10. On the **Management** page, make any changes to the monitoring options.
72
69
11. On the **Guest config** page, add any extensions as needed.
0 commit comments