Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to start a azure deallocated vm?

I needed to do a vm backup and I followed this article: https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-linux-capture-image/

So, I executed: azure vm shutdown vm-1

But now I really need to start the deallocated vm but I don't know how to do it.

When I try to execute this command: Start-AzureVM -ServiceName "vm-1" -Name "vm-1"

I'm getting this message: No deployment found in service: 'vm-1'.

And when I try to list all my vm, I don't see vm-1

Any idea of how to start a deallocated vm?

Thanks

like image 757
coder Avatar asked Sep 17 '25 06:09

coder


1 Answers

Understood your problem. Your VM has been deleted by you and you want it back. Now in order to back your vm you need to make sure you have the vhds of the vm in place.

a. Find out the vhd and convert it to disk(OS Disk and data disk).

b. Use the OS disk's diskname to create a new vm using this powershell-

Set-AzureSubscription -SubscriptionId "xyz" -CurrentStorageAccountName "lmn"
$vm=New-AzureVMConfig -DiskName "OSDiskDiskName" -InstanceSize "InstanceSizeofvm" -Name "VMName" 
New-AzureVM -Location "LocationName" -ServiceName "abc" -VNetName "vNetName" -VM $vm -verbose

c. Find out the data disk and attach to the newly created VM.

In case you have deleted the vhds as well, raise a ticket with MS, only they can help you in that case.

like image 197
Aatif Akhter Avatar answered Sep 19 '25 21:09

Aatif Akhter