question

Tim-2350 avatar image
0 Votes"
Tim-2350 asked kobulloc-MSFT answered

Duplicate existing Azure VM to create a test environment

Duplicate existing Azure VM to create a test environment.

We want to use an existing production VM as template to create a test environment which mirrors the production VM as is.

We want to use this test VM to try the upgrade process for various systems before attempting upgrades on production.

Can we use an existing Azure VM to create a test environment without impacting on the main production env?

azure-virtual-machines-backup
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

kobulloc-MSFT avatar image
0 Votes"
kobulloc-MSFT answered

Hello, @Tim-2350!

There are many ways to duplicate a VM but the requirement not to impact the production environment may be a difficult restriction as with most approaches you will want to shut down the source VM to clear out any processes that are in progress.

Create a Snapshot
https://docs.microsoft.com/en-us/azure/virtual-machines/snapshot-copy-managed-disk?tabs=portal
This creates a full copy of the VHD. You'll create a snapshot using either the portal, PowerShell, or CLI, then deploy a VM from the snapshot using the new managed disk.

To create a snapshot using the Azure portal, complete these steps.

In the Azure portal, select Create a resource.
2. Search for and select Snapshot.
3. In the Snapshot window, select Create. The Create snapshot window appears.
4. For Resource group, select an existing resource group or enter the name of a new one.
5. Enter a Name, then select a Region and Snapshot type for the new snapshot. If you would like to store your snapshot in zone-resilient storage, you need to select a region that supports availability zones. For a list of supporting regions, see Azure regions with availability zones.
6. For Source subscription, select the subscription that contains the managed disk to be backed up.
7. For Source disk, select the managed disk to snapshot.
8. For Storage type, select Standard HDD, unless you require zone-redundant storage or high-performance storage for your snapshot.
9. If needed, configure settings on the Encryption, Networking, and Tags tabs. Otherwise, default settings are used for your snapshot.
10. Select Review + create.

Another option that won't create an exact copy but may be worth mentioning is a duplicate ARM deployment. This would allow you to deploy an identical VM that you could configure the same as your production environment. While not the mirror copy that you are looking for, it would have no impact on your production environment.

https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/export-template-portal

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.