Preparing to Upload a Vhd File to Azure

In this commodity, I will describe how to upload a vhd file that contains some information. And then I volition attach this uploaded vhd to an existing Azure Virtual Machine using the following process:

  • Convert the vhdx file to vhd
  • Upload the vhd file to Azure
  • Attach this uploaded vhd disk to a VM

I volition employ the Azure Portal and Windows PowerShell to perform these tasks.

Delight annotation that this guide can be used to import a elementary VHD disk containing information, or to import a Virtual Car epitome. In both cases, you must upload the VHD deejay to Azure and then:

  • Adhere the disk to an existing VM
  • or create an Azure Epitome based on the uploaded VHD deejay. Then, you can create a new Virtual Machine using this epitome. If y'all want to upload a VM to Azure, you must sysprep the Bone as a prerequisite. In one case yous have finished the customization, navigate to c:\windows\system32\sysprep and run sysprep.exe. Run the system training with the following settings:

system preparation with the following setting

Creating the VHD disk

Let's outset past creating a VHD disk. In this example, I will create a local VHD file using the disk management utility. Click "Action" and select "Create VHD":

create and attach virtual hard disk

I selected VHDX to draw how to convert a VHDX disk to VHD format. Wait until the VHDX deejay is successfully created.

convert a VHDX disk to VHD format

Next, you tin can initialize the disk and format the partition. Open the Windows Explorer and confirm that you lot tin create an item on the deejay.

сreating the VHD disk - initialize

In my case, I will re-create and paste the SCCM executable.

сreating the VHD disk - SCCM executable

When you are ready to import you VHDX to Azure, you can disassemble the disk. First, select "Offline" and then "Detach VHD":

import VHDX to Azure

Converting the VHD disk

Before uploading the VHDX to Azure, y'all must catechumen the disk to the VHD format. Azure does not support VHDX disks, so you must run the post-obit PowerShell command to perform this task:

converting the VHD disk - PowerShell console

convertthe VHD disk - PowerShell console - Administrator

Notation:

  1. Open up the PowerShell console as "Administrator"
  2. The Hyper-V Virtual Motorcar Management Windows Service must exist running.

Hyper-V Virtual Machine Management

I can confirm that the VHD file has been successfully created:

successfully creating VHD file

VSAN from StarWind is software-defined storage (SDS) solution created with restricted budgets and maximum output in mind. It pulls shut to 100% of IOPS from existing hardware, ensures high uptime and fault tolerance starting with just two nodes. StarWind VSAN is hypervisor and hardware agnostic, allowing you to forget about hardware restrictions and crazy expensive physical shared storage.

Build your infrastructure with off-the-shelf hardware, calibration however you lot like, increase render on investment (ROI) and enjoy Enterprise-grade virtualization features and benefits at SMB price today!

Uploading the VHD disk

For the next steps, you must take Azure-RM PowerShell module installed on your workstation because we will utilize the Add-AzureRmVhd cmdlet. This cmdlet uploads a virtual hard disk drive from an on-bounds virtual auto to a hulk in a deject storage account in Azure. Open the PowerShell console, and connect to your Azure subscription:

PowerShell console - Administrator - Add Azure RmVhd

Now, we need to create a container and take hold of the URL needed to upload our VHD disk. Open your Storage Account, and navigate to "Containers" and click "+ Container" to create the container:

azure - storage account - uploading VHD disk

You can get the URL from the Azure portal when you lot go into the Storage Business relationship:

  • Blobs
  • Container
  • Containers Backdrop

azure - storage account - blobs - container - containers properties

I did this through the Azure Resources Manager (ARM) Portal but yous also can recollect this information with PowerShell past creating an Azure Storage Context:

Azure Resource Manager (ARM) Portal

Now, you tin can hands build the URL backdrop:

Azure Resource Manager (ARM) Portal - URL properties

OK, nosotros are gear up to import the VHD file to Azure. Use the post-obit commands:

import the VHD file to Azure - commands

Depending on the size of your VHD disk, y'all must expect a moment…

depending the size of VHD disk

Once the upload is done, I can ostend that the VHD file exists in my Azure storage.

VHD file - Azure storage

For those of you who adopt to use the Azure portal, y'all tin upload the VHD disk by clicking "Upload":

Azure portal - uploading the VHD disk

Attaching the VHD deejay or Creating a new VM

To finish, open the Virtual Machine blade, and select "Disks" to attach the uploaded disk:

Virtual Machine blade - attaching VHD disk

If you desire to create a new VM based on the uploaded VHD deejay, you lot volition demand first, to create an Azure Image:

creation a new VM - creation an Azure Image

Do not be mistaken by clicking "Add data disk". Here, we want to create the OS deejay, not the information disk!

To stop, set up the VM prototype every bit a source image for the new VM. So ready the source image using the ID of the managed VM image:

$vm = Set-AzureRmVMSourceImage -VM $vm -Id $image.Id

If you need more than information, y'all can read the post-obit documentation: https://docs.microsoft.com/en-us/azure/virtual-machines/windows/upload-generalized-managed

Conclusion

You can easily upload your VHDX and VHD disks from on-premises to Azure using PowerShell and the Azure Portal. Sometimes, you must use PowerShell because some features are not implemented in the portal.

Before a full migration of your Virtual Machines, moving individual Virtual Machine can be interesting in social club to test if your workload works every bit expected in Azure.

Thanks for reading!

costahaping.blogspot.com

Source: https://www.starwindsoftware.com/blog/migrate-on-premises-vhd-files-to-azure

0 Response to "Preparing to Upload a Vhd File to Azure"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel