Swapping the OS disk (temporary) of a VM for another disk

Bruno Ferraresi 21 Reputation points
2021-12-06T21:26:45.227+00:00

I need to swap the OS disk (temporary) of a VM for another disk that was created after the VM was created, the disk has the same size, the same type (128 GiB Standard SSD LRS), and with the shared disk function disabled, in my understanding this should be enough to be able to swap the OS disk, however when I click on the "Swap OS disk" button, in Disks inside the vm the created disk is not even showing in the "Choose disk" space, and when I try to use power shell command I get the following warning as shown in the link image: https://prnt.sc/22221kh

I figured, then is so set the attribute: "VM generation"(which was empty) so that the problem is solved but I did not find something that explains how I can set such attribute of the disk, I tried with the disk coupled, uncoupled, with the VM on(which obviously is wrong and went wrong), and with various sizes and type of VM... not succeeded so I come here to know how I can meet my goal.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,044 questions
Azure Disk Storage
Azure Disk Storage
A high-performance, durable block storage designed to be used with Azure Virtual Machines and Azure VMware Solution.
668 questions
0 comments No comments
{count} votes

Accepted answer
  1. Pradeep Kommaraju 2,626 Reputation points
    2021-12-07T05:31:50.207+00:00

    Hi @Bruno Ferraresi

    Thank you for reaching out to Microsoft Q&A Platform .

    The suspected root cause is either of the following :

    1) Either you are hitting a known bug which was fixed recently , Which had exactly the same symptoms .
    or
    2) The other disk which you are talking about is not created from the current VM backups .

    The only workaround in your situation is as follows:

    1) Take a snapshot of the current OS Disk again .
    2) Create a new Disk out of the snapshot in the same region/zone where the current VM is running .
    3) Use this newly created disk to swap the OS .
    4) And you can delete the previous backup disk that you are talking about .

    Hope this helps in use case .

    Thanks & Regards,
    Pradeep


    Pease don't forget to accept the answer if this was helpful .

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.