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:
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":
I selected VHDX to draw how to convert a VHDX disk to VHD format. Wait until the VHDX deejay is successfully created.
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.
In my case, I will re-create and paste the SCCM executable.
When you are ready to import you VHDX to Azure, you can disassemble the disk. First, select "Offline" and then "Detach VHD":
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:
Notation:
- Open up the PowerShell console as "Administrator"
- The Hyper-V Virtual Motorcar Management Windows Service must exist running.
I can confirm that the VHD file has been successfully created:
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:
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:
You can get the URL from the Azure portal when you lot go into the Storage Business relationship:
- Blobs
- Container
- Containers Backdrop
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:
Now, you tin can hands build the URL backdrop:
OK, nosotros are gear up to import the VHD file to Azure. Use the post-obit commands:
Depending on the size of your VHD disk, y'all must expect a moment…
Once the upload is done, I can ostend that the VHD file exists in my Azure storage.
For those of you who adopt to use the Azure portal, y'all tin upload the VHD disk by clicking "Upload":
Attaching the VHD deejay or Creating a new VM
To finish, open the Virtual Machine blade, and select "Disks" to attach the uploaded 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:
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!
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