Provisioning sanitized data with SQL Clone and Data Masker. Watch now.

Recovery pending after Azure virtual machine stopped / started

We have multiple DBs on an Azure VM, most are cloned DBs and some are stand-alone.

After a nightly cost-saving shutdown of the SQL Server VM, the next day the stand-alone DBs are fully accessible but cloned DBs are stuck in "Recovery Pending" state for some significant time period given the volume of cloned DBs we have.

The SQL Clone Agent is started.

Is there anything we can do to stop this without keeping the VM online 24/7?

Best Answers

  • Eddie DEddie D Posts: 1,736 Rose Gold 5
    Thank you for your forum post.

    The SQL Server instance that hosts your clone databases, believes it connects to a normal database with local files that it can read and write too. It has no understanding of SQL Clone processes in the background.  Each clone database's data has been virtualized. In other words, without SQL Server being aware of it, a clone's database files are not local; the database and its data (i.e. its data and log files) are held in the image VHD, in a shared folder on the network.

    Each time you perform your shut-down the link between each clone and the image VHD file is broken.  So when you restart the Azure VM, each clone needs to reestablish the link to the image VHD from which the clone was created.  Until the connection to the image VHD is reestablished, the clone databases will be stuck in "Recovery Pending" state.  Sadly there is nothing that can be configured to prevent this from occurring if you wish to shutdown the Azure VM each night.
    Eddie Davis
    Senior Product Support Engineer
    Redgate Software Ltd
    Email: [email protected]
  • GregTrevellickGregTrevellick Posts: 8 New member
    Thanks Eddie 
Sign In or Register to comment.