How to Upload Large Files to Azure Vm
27. January 2014 15:34
I recently needed to motility some large installer files onto a virtual machine on my Azure subscription. Rather than post-obit the trend, I thought I would endeavour of my own concepts and succeeded in finding a good technique.
Amid the community at the moment, there are a number of dissimilar opinions and recommendations around how make big installers available to the virtual machines running on Azure. Hither are some that I tin remember:
- Share local drives using Remote Desktop Connection.
- Setup an FTP server on your virtual machine, then use an FTP customer to upload the files.
- If these files are bachelor on a website (such equally Microsoft.com), then download the installer straight off the web onto the virtual machine (you may fifty-fifty choose to use SkyDrive).
Some of the disadvantages of the above approaches that I tin see are:
- You may not get optimum transfer rates depending on the method of upload that you are using.
- For very large files, the virtual motorcar may encounter a networking issue that kills the download half way through.
- At that place is a dependency on your virtual motorcar running while yous copy the files on to it. (This is my biggest issue with information technology every bit I'g using an A6 machine therefore each such transaction has a computation toll associated to it).
In order to get around the higher up limitations, I thought of uploading pre-populated VHD drives via PowerShell. To this:
1. Create a blank VHD file (y'all can also use an existing one if you already have information technology).
You can do this by navigating to Authoritative Tools > Calculator Management > Disk Management. Right click Create VHD and follow the instructions.
2. Once you have created the VHD, yous can use the Adhere VHD option and assign a drive letter of the alphabet for the VHD to appear in your listing of drives in Windows Explorer.
3. Y'all can then copy all of the files that you require to upload onto your virtual machine onto this drive. (Its a skilful idea to organise your files into structured folders rather than having a clutter of files in the root).
iv. Upload the VHD file onto Azure using PowerShell.
Yous should read and follow the instructions at: http://www.windowsazure.com/en-the states/documentation/articles/virtual-machines-create-upload-vhd-windows-server/
This will take you through how to upload a VHD file.
Hither is a dump of my PowerShell code for this:
Import-Module azure Become-AzurePublishSettingsFile Import-AzurePublishSettingsFile "C:\credentials.publishsettings" # This only lists your Azure Subscriptions Get-AzureSubscription Set up-AzureSubscription -SubscriptionName "[SUBSCRIPTIONNAME]" -CurrentStorageAccountname "[BLOBSTORAGEACCOUNTNNAMEYOUCREATED]" -CurrentStorageAccount [BLOBSTORAGEACCOUNTNAMEAGAIN] Add-AzureVhd -Destination http://portal---------.blob.core.windows.net/MYCONTAINER/MYVHD.vhd -LocalFilePath C:\MYVHD.vhd
5. Attach the VHD to your virtual car.
You lot should read the follow parts of the instructions here: http://www.windowsazure.com/en-us/documentation/articles/storage-windows-adhere-disk/
Note that the 'Attach' option dynamically offers different options depending on whether or not you have a mountable VHD available on your storage or not.
Once you have fastened the VHD to your virtual motorcar, you lot should be able to meet the bulldoze announced in Windows Explorer (on your virtual machine). At present you can collaborate with as if information technology is directly connected to your virtual automobile.
Hither are some of the advantages of using this approach:
- You don't take to have your virtual car turned on while you copy your data to the cloud. In my case, this saves me a lot of money. Particularly as I tin can get out for something to get uploaded past PowerShell overnight.
- Once you have uploaded this drive one fourth dimension, you tin can attach and utilize it in multiple machines. Lets say y'all have 5 split up servers or development machines, y'all would only need to upload the VHD one time. This will relieve you lot time and bandwidth. (You cannot currently adhere one VHD to many virtual machines at the same time. You will demand to detach the hard drive from the first virtual machine earlier attaching it to the next).
- You tin can e'er download the VHD over again via PowerShell if you want to finish paying for the storage space (used by the VHD). You lot can also add more installers to it (you tin can also add together contents to it directly from the virtual machine, and so download the VHD with content already on there).
The but affair you should exist aware of is that you lot will be paying for the disk space that this VHD uses on Azure. If you become too adventurous, y'all could run up a neb. I use it for a 20gb drive, which does not toll much monthly.
If yous need a solution to exist able to access the bulldoze from many virtual machines at the same time, you lot could try mapping a network drive to i virtual auto that the VHD is fastened to but I have non tried this.
Promise this helps.
Source: http://blog.zebsadiq.com/post/Azure-Best-way-to-upload-large-installers-files-to-Virtual-Machines.aspx
0 Response to "How to Upload Large Files to Azure Vm"
Post a Comment