"Our production SQL Server VM at Azure is down, and we cannot provide service to clients."
A short analysis showed that we were in deep trouble:
- The server status was "stopped (failed to start)".
- Repeated tries to start the server resulted in starting ... and back to the fail message.
- Changing instance configuration as proposed in various forums and blogs resulted in the same fail message.
- Microsoft claims that everything is OK with its data centers.
- Checking the Azure storage container found out that the specific VHD disk was not updated since the server failure.
- Start a new instance in the same availability set (that way you can continue using the same DNS name, instead of also deploying a new version of the app servers).
- Attach a new large disk to the instance (the failed server disk was 127GB, make sure the allocated disk is larger).
- Start the new machine.
- Format the disk as a new drive.
- Get to your Azure account and download the VHD file from Azure storage. Make sure you download it to the right disk. We found out that the download process takes several hours even when the blob storage is in the same data center as the VM.
- Mount the VHD file you downloaded as a new disk.
- Extract the database and log files from the new disk and attach them to the new SQL Server instance.
- Keep your backup files updated and in a safe place.
- Keep your database data and log files out of the system disk, so you could easily attach them to other servers.