Restore accidentally deleted VM and attached disk

VENKATARAMANA CHAKRAVARTHULA 0 Reputation points
2024-07-01T21:43:02.5766667+00:00

I have deleted my VM accidentally and attached disk.

Can someone please help how to restore it ?

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

2 answers

Sort by: Most helpful
  1. akinbade abiola 8,705 Reputation points
    2024-07-01T23:05:32.63+00:00

    Hello VENKATARAMANA CHAKRAVARTHULA,

    Thanks for your question.

    Restoring an accidentally deleted VM and its attached disk in Azure can be done if you have previously set up backups using Azure Backup.

    To do this follow the steps here:

    https://learn.microsoft.com/en-us/azure/backup/backup-azure-arm-restore-vms?source=recommendations#select-a-restore-point

    You can mark it 'Accept Answer' and 'Upvote' if this helped you

    Regards,

    Abiola

    0 comments No comments

  2. kobulloc-MSFT 26,131 Reputation points Microsoft Employee
    2024-07-02T14:03:16.8666667+00:00

    Hello, @VENKATARAMANA CHAKRAVARTHULA !

    How do I restore an accidentally deleted VM?

    If you have a backup or a snapshot of the VM, then you can restore the VM:

    https://learn.microsoft.com/en-us/azure/backup/backup-azure-arm-restore-vms

    If you did not backup or create a snapshot of the VM and disks have been deleted, then unfortunately the VM has been permanently deleted.

    How can I prevent this from happening in the future?

    There are several options you can take advantage of to make sure you don't end up in this situation :

    • Lock your resources to protect your infrastructure : Using a lock like CanNotDelete will prevent the resource/VM from being accidentally deleted.
    • Azure Backup: Azure backups can be created through the Azure portal. This method provides a browser-based user interface to create and configure Azure backups and all related resources.
    • Soft delete for Azure Backup: With soft delete, even if a malicious actor deletes a backup (or backup data is accidentally deleted), the backup data is retained for 14 additional days, allowing the recovery of that backup item with no data loss.
    • Azure Disk Backup : Azure Disk Backup is a native, cloud-based backup solution that protects your data in managed disks. It's a simple, secure, and cost-effective solution that enables you to configure protection for managed disks in a few steps. It assures that you can recover your data in a disaster scenario.
    • Selective disk backup and restore for Azure virtual machines : Azure Backup supports backing up all the disks (operating system and data) in a VM together using the virtual machine backup solution. Now, using the selective disks backup and restore functionality, you can back up a subset of the data disks in a VM. This provides an efficient and cost-effective solution for your backup and restore needs.

    I hope this has been helpful! Your feedback is important so please take a moment to accept answers.

    If you still have questions, please let us know what is needed in the comments so the question can be answered. Thank you for helping to improve Microsoft Q&A!

    User's image

    0 comments No comments