Export (0) Print
Expand All

How to create a SQL Server virtual machine in Azure using the existing on-premises SQL Server disk

Updated: February 28, 2014

This topic describes how to create a SQL Server virtual machine in Azure by using the on-premises SQL Server virtual hard drive (VHD) file.

  1. Create a Windows Server virtual machine by using the steps provided in the How to create a base virtual machine on-premises using Hyper-V.

  2. Then, perform a complete setup of SQL Server in this virtual machine.

  3. Before uploading any virtual machine VHD file to Azure, make sure that the remote desktop is enabled. Because Windows Firewall restricts communication between your computer and the Internet, you might need to change settings for Remote Desktop Connection so that it can work properly. You can find detailed information on how to enable remote desktop connection at Enable Remote Desktop. In addition, you must remove the virtual machine from your on-premises network if it is connected already. For more information, see Get Connected in Windows Server Essentials.

  4. Shut down the virtual machine.

    Important: You don’t need to Sysprep the virtual machine as this topic focuses on how to upload it Azure as a disk.

  5. To upload a virtual hard drive contained in a VHD file to Azure, first create and install a management certificate. For more information on how to create a management certificate, see Create and install a management certificate section in the How to copy SQL Server data and setup files in a data disk from on-premises to Azure topic.

  6. Then, follow the instructions given in the Upload the VHD file to Windows Azure using Add-AzureVHD section of the How to copy SQL Server data and setup files in a data disk from on-premises to Azure topic. Simply, open up the Windows Azure PowerShell window, connect to your subscription, and run the Add-AzureVHD cmdlet. The following is an example code that shows how to use the Add-AzureVHD cmdlet:

    Add-AzureVhd -Destination <BlobStorageURL>/<YourImagesFolder>/<VHDName> -LocalFilePath <PathToVHDFile>
    

    Where BlobStorageURL is the URL for the storage account that you created earlier. You can place the VHD file anywhere within your Blog storage. YourImagesFolder is the container within blob storage where you want to store your images. VHDName is the label that appears in the Azure Platform Management Portal to identify the VHD. PathToVHDFile is the full path and name of the VHD file.

    The upload process might take a few minutes.

  7. Log on to the Azure Platform Management Portal.

  8. After you upload the .vhd file to Azure, you need to add it as a disk to the list of custom disks associated with your subscription.

  9. Click Disks at the Virtual Machines panel. In the Create a Disk from VHD dialog window, type Name, such as SQLVM1NoSysPrep. Then, browse to the VHD URL. Choose the storage account, the container, and then the VHD file, such as SQLVM1Disk.vhd. Check the The VHD contains an operating system. Choose Windows as an operating system family.

  10. Click Disks. You should be able to see the newly uploaded virtual hard drive, such as SQLVM1NoSysPrep as one of the disks.

  11. Click Virtual Machines, New, Compute, Virtual Machine, From Gallery.

  12. Click My Disks. You should be able to see the newly uploaded virtual hard drive, such as SQLVM1NoSysPrep as one of the disks.

  13. Choose the newly uploaded Operating System Disk, such as SQLVM1NoSysPrep.vhd. To continue, click the next arrow.

  14. In the Virtual machine configuration dialog window, type Virtual Machine Name, such as SQLVMNoSys. Select Size as Large (4 cores, 7GB Memory). To continue, click the next arrow.

  15. In the Virtual machine mode dialog windows, choose Standalone Virtual Machine, type SQLVMNoSYS as DNS name, choose a region. To continue, click the next arrow.

  16. In the Virtual machine options page, keep the default values. Click the check mark.

  17. Once the provisioning is done, you can connect to your new virtual machine by using the Remote Desktop connection.

Community Additions

ADD
Show:
© 2014 Microsoft