3

I accidentally deleted two Azure VM from Portal. I wish there is some procedure to recovery them. I'm going around in the portal but I cannot find any option, no backup was made and I think that the disks are deleted too.

Can you help me?

  • Do you have a recovery services vault? – Alex Jan 12 '17 at 18:48
  • Our Recovery Services Vault is empty... Is possibile that Microsoft can recovery the VM? It's incredible if it's so easy lose data and work... – Yiyi Chen Jan 12 '17 at 18:50
  • I afraid you are in trouble. – Alex Jan 12 '17 at 18:54
  • 1
    "Is possibile that Microsoft can recovery the VM?" - Microsoft does not have access to your VMs nor do they have the capability to restore something you didn't backup into the Recovery Services Vault. – Ramhound Jan 12 '17 at 19:29
1

By default, if you delete Azure VMs on Azure Portal, VM’s VHDs are not deleted. So, you could use the VHDs to recreate your VMs. Please refer to following steps.

1.Find your VM’s VHD in storage account.

enter image description here

If you don’t sure which VHD is your VM’s VHD, you could use the following cmdlet. Deleted VM’s VHD is not used.

$RGName = "shui" $SAName = "shuidisks154" $ConName = "vhds" $TempObj = New-Object -TypeName PSCustomObject $TempObj |Add-Member -Name BlobName -MemberType NoteProperty -Value $null $TempObj |Add-Member -Name LeaseState -MemberType NoteProperty -Value $null $Keylist = Get-AzureRmStorageAccountKey -ResourceGroupName $RGName -StorageAccountName $SAName $Key = $Keylist[0].Value $Ctx = New-AzureStorageContext -StorageAccountName $SAName -StorageAccountKey $Key $List = Get-AzureStorageBlob -Blob *.vhd -Container $ConName -Context $Ctx $List | ForEach-Object { $TempObj.BlobName = $_.Name; $TempObj.LeaseState = $_.ICloudBlob.Properties.LeaseState; $TempObj } 2.Use the VHD to recreate your VM by using template.

Update:

If you delete your VM's VHD, you could not recovery your VM without backup.

  • @YiyiChen You had better check your storage account, if the VHD was deleted, unfortately, you could not recovery your VM without backup. – Shui shengbao Jan 13 '17 at 13:22
  • At the end the VMs and disks were definitively lost. Fortunately weren't a big data loss. My co-workers made (and still now) made some big laughs. My "punishment" is this desktop background that I have to keep on my new VM. Anyway I sent a feedback using Azure Portal for moving Delete button far away from others most used (like Stop) and for change the actual delete confirmation with something like Resorces Group cancellation that ask you to type the name of the element that you want to delete. Thank you all anyway. – Yiyi Chen Feb 10 '17 at 9:16
  • @YiyiChen Thanks for you feedback, I will report it to our developer. If possible, I suggest you use Azure Backup. Don't worry to delete your VM accidentally. More information please refer to this link – Shui shengbao Feb 10 '17 at 9:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.