Clone VM's OS disk to use on another VM

PT Maliborski 266 Reputation points
2024-05-31T12:20:01.9866667+00:00

Hi,

I have a VM in Azure (myVM-001) joined on-prem ADDS, running WS2022.

I need to clone above VM to create new VM (myVM-002) also joined the same ADDS.

So far:

  1. Created OS disk snapshot of myVM-001, and from that created myVM-002. Obviously myVM-002 in ADDS automatically got DNS name on myVM-001 - so that didn't work out
  2. From the same snapshot created Managed Disk and deployed myVM-002 from it - the same situation as point 1 - didn't work out.
  3. Created Gallery Image Version from OS disk myVM-001. While deploying myVM-002from this image, deployment failed telling me that image was not prepared correctly (although it created myVM-002). However, myVM-002 again shows as myVM-001.

I'm sure I'm not the first person trying to clone OS disk and create from it totally new VM.

What are the simple steps to achieve this?

Any help appreciated

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,416 questions
0 comments No comments
{count} votes

Accepted answer
  1. Deepanshukatara-6769 6,470 Reputation points
    2024-05-31T12:34:05.56+00:00

    Hi PT, welcome to MS Q&A

    Before proceeding with any cloning methods, ensure that myVM-001 is sysprepped to generalize the OS and remove unique identifiers. This step is crucial to avoid conflicts with the domain.

    Please check this doc to do this https://learn.microsoft.com/en-us/azure/virtual-machines/generalize

    By running Sysprep on myVM-001 before cloning, you ensure that the cloned VM (myVM-002) will have a clean and generalized Windows installation, ready to be joined to the domain without conflicts. Always remember to run Sysprep before cloning any Windows VM, especially when dealing with domain-joined environments like Active Directory.

    After this ,

    1. Take a Snapshot of the OS Disk:
      • In the Azure portal, navigate to the disks associated with myVM-001.
      • Select the OS disk and create a snapshot from it.
    2. Create a New Managed Disk from the Snapshot:
      • From the snapshot created in step 2, create a new managed disk.
      • Ensure that the disk is generalized and doesn't contain any specific configuration tied to myVM-001.
    3. Deploy a New VM (myVM-002) from the Managed Disk:
      • Create a new VM (myVM-002) using the managed disk created in step 3.
      • During VM creation, specify the necessary configurations such as networking, storage, and resource group.
      • Join myVM-002 to the same on-prem ADDS as myVM-001 during the provisioning process.
    4. Update VM Configuration:
      • Once myVM-002 is deployed, ensure that its computer name and IP address are unique and not conflicting with myVM-001 or any other existing resources in the network.
    5. Verify DNS Settings and Active Directory Records:
      • Confirm that myVM-002 has the correct DNS settings pointing to your on-prem ADDS.
      • Update the DNS records in your on-prem ADDS with the new IP address and hostname of myVM-002.

    Kindly check and let us know if any further questions

    Please accept answer if it helps, Thanks!


0 additional answers

Sort by: Most helpful