Microsoft Azure Virtual Machine got stuck at boot up with message “Getting device ready”
Follow the steps below to fix it.
- Capture the Virtual Machine configuration information from Azure Portal
$rgname = “ResourceGroupName”
$loc = “DatacenterName”
$vmsize = “Standard_E4_v3”
$vmname = “ServerName”
$nic=”NicName”
$osDisk=”OSDiskName”
- Note the Operating System Disk location
- Delete Virtual Machine form Azure
- Attached the Operating System Disk to another VM at Azure as secondary disk
- Login to Azure VM where you attached the OS disk
- Open registry editor and go to file Load Hive
- Browse “C:\Windows\system32\config” select System file and load
-
- Open regedit and navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\AppFabricCachingService
- Add a Multi-String value called “DependOnService”
- Edit the value and type in “CryptSvc”
- Reboot with SAFER policy applied
- Detached the Operating System Disk from temporary server
- Create the Virtual Machine back with following script
Add-AzureRMAccount
Select-AzureRmSubscription -SubscriptionId “SubscriptionID”
$rgname = “ResourceGroupName”
$loc = “DatacenterName”
$vmsize = “Standard_E4_v3”
$vmname = “ServerName”
$vm = New-AzureRmVMConfig -VMName $vmname -VMSize $vmsize;
$nic = Get-AzureRmNetworkInterface -Name (“niname”) -ResourceGroupName $rgname;
$nicId = $nic.Id;
$vm = Add-AzureRmVMNetworkInterface -VM $vm -Id $nicId;
$osDisk = get-azurermdisk -ResourceGroupName $rgName -DiskName “DiskName”
$vm = Set-AzureRmVMOSDisk -VM $vm -ManagedDiskId $osDisk.Id -StorageAccountType StandardLRS -CreateOption Attach -Windows
$vm=Set-AzureRmVMBootDiagnostics -VM $vm -Disable
New-AzureRmVM -ResourceGroupName $rgname -Location $loc -VM $vm -Verbose