[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 242
  • Last Modified:

Recreate virtual machine from vhd in Azure

I accidentally deleted a VM in https://portal.azure.com but still have the VHD. How do I recreate the VM using that VHD disk? I see guides out there telling I should create from gallery, but I see no option to select from gallery when I choose to create a new VM.
0
itnifl
Asked:
itnifl
  • 2
  • 2
1 Solution
 
Zachariah BrowningCommented:
If you go to the manage.windowsazure.com and go to create a new VM, from gallery  there is a section 'My Disks' you should see your VHD under that section to create a new VM with.  If you want to create the VM in a region other than where the VHD is in azure then you can use a tool like AZCopy to move your vhd to a new region for the creation of your new VM.  If you have trouble with that method, then you can make an image out of that disk and create a VM from that image.

if you need to create an image from that Disk, then you can use Powershell.
    Add-AzureVMImage -ImageName <ImageName> -MediaLocation "https://<StorageAccountName>.blob.core.windows.net/<ContainerName>/<vhdName>.vhd" -OS "Windows"

let me know if you have any further trouble with this.
0
 
itniflAuthor Commented:
Thanks for that. It seems that my account has no administrative privileges. I get this when I enter manage.windowsazure.com:

Before you can start using Microsoft Azure, you need to get a subscription.
We were unable to find any Azure subscriptions where you are a service administrator or co-administrator.
You are signed as xxx@xxx.com in the directory xx.onmicrosoft.com ('xx xx'). If this was not the account you intended to use, please sign out and sign in again using the intended account.
Have DreamSpark or CSP? Visit portal.azure.com

Is there a way to get the privileges I need?
0
 
Zachariah BrowningCommented:
I'm sorry , the only way you can get administrative privileges is if they are granted to you by a global admin or subscription owner.  - if you had this server in your own subscription then you may want to make sure that you are logged into the correct directory, or correct account as it states in the message. you can check this in the top right drop down  "Default Directory" is (usually) the directory of choice.
0
 
itniflAuthor Commented:
I see. It turns out that I have some trouble with my MSDN subscription. It was linked to the wrong account. I have tried to de-attach it from the wrong account and attach it to the right one, but seems like it made the mess worse. I have contacted Microsoft support for that, but at least I am on the right track now. Thanks !
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now