Assigned existing SQL Virtual Machine from old virtual machine to newly restored virtual machine

Ma. Kassandra Bernabe 45 Reputation points
2025-05-20T03:34:58.08+00:00

Hi!

May ask if it is possible to migrate the existing SQL Virtual machine assigned from the old virtual machine to the newly restored virtual machine?

At first, we created a SQL server for VM so we have 2 modules were created, Virtual Machine and SQL virtual machine. It was working until there was an unexpected error, so we were forced to restore the virtual machine by creating a new VM.

User's image

Our restored virtual machine was working and is currently used and able to access and query in SQL server inside the VM of DB2. But what we are concerned that the SQL virtual machine module was not created when we restored the VM
User's image

The VM of DB2 was missing in the SQL Virtual machine, Is there a way to reassign from the old VM to the new VM without creating a new SQL virtual machine? Or is there a way to add a VM of DB2 in SQL virtual machine?

Azure SQL Database
{count} votes

Answer accepted by question author
  1. Saraswathi Devadula 13,495 Reputation points Microsoft External Staff Moderator
    2025-05-22T07:51:25.0033333+00:00

    Hello Ma. Kassandra Bernabe

    During our discussion, you encountered an issue where the SQL virtual machine was not visible, despite its successful creation.

    Upon reviewing the configuration, we discovered that the SQL server configuration was not enabled, indicating that the SqlIaasExtension had not been installed.

    Subsequently, we assisted you in starting the SQL server via the services within the virtual machine and executed specific commands to install the required extension.

    $vm = Get-AzVM -Name <Remove the bracket and give the VM name> -ResourceGroupName  <Remove the bracket and give the RG name>
    
    New-AzSqlVM -Name $vm.Name -ResourceGroupName $vm.ResourceGroupName -Location $vm.Location -LicenseType PAYG -SqlManagementType Full
    

    After the extension was installed, the SQL virtual machine became visible.

    Please try restarting your VM outside of business hours and provide us with an update.

    Thank you.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.