Taking Disk Snapshot In Azure
learn how to take disk snapshot,create disk from snapshot and attach to VM.
3 min read
There are many times when you may want to replicate the content of the disk. For example, if you have a virtual machine and you have some data to the VM A disk and you want the same data to be available to VM B. So in this case, a snapshot comes in the picture. You can take the snapshot of the data disk and create a new disk of that snapshot. Later you can attach that disk to the virtual machine. Snapshots also can be used to take a backup of an OS or a data disk. Please note that this is a separate resource and you will be charged for this accordingly.
So to demonstrate this, I am going to use two virtual machines which are having a Windows server as an underlying OS and they're in the same location. Let us see how can we implement this concept using these two machines.
So I am going to demovm and click on the disk and then create and attach the disk. if you don't know how to create and attach a disk then you can learn from these articles.
Before creating the snapshot, I have connected it to my demovm and I have added some data on the disk.
So go to the disk and click on the disk then you will be redirected to the overview page.
Click on create snapshot and then fill in the details and click on review and create. Give it some time for deployment.
Enter the details and for other tabs leave everything as it is. But go to Network and choose public endpoint (all network).
Once the deployment is complete, go-to resource. Again remember this will be a separate resource and you will be charged for this accordingly.
When the deployment is complete you need to go to the resource itself and click on create disk because remember we are creating disk from the snapshot and this disk will have all the data of the disk from demovm. So click on Create Disk and fill in all the details and give it some time for deployment. Once the deployment is complete, the disk will be ready to attach to the demovm2.
Now fill in all the details and leave everything as it is. After filling in all the details click on Review and Create.
Now we are done with creating a snapshot and creating a disk of that snapshot. Now let us go and attach this to our second virtual machine. So I am going to demov2 and click on disk. Then click on attach the existing disk. Now you will see the list of the disk. If don't see the disks then please refresh the page and you will see the newly created disk. which is used for the snapshot.
Now, I will go to demovm2 and then connect to this machine. Now you will see the server manager dashboard click on file and service. Then click on the disk. You will see the disk attached there.
Now if you will open the drive from explorer then you will see the content of the disk from demovm.
So in this article, we created a disk-based on the snapshot and then attach it onto another Azure virtual machine. Feedbacks are appreciated and feel free to ask if you have any confusion. Thanks for reading and stay safe.