Upload a VHD to Windows Azure
Updated: October 18, 2011
[The VM Role feature of Windows Azure is being retired on May 15th, 2013. After the retirement date, VM role deployments will be deleted. To move forward with your existing applications, you can use Windows Azure Virtual Machines. For more information about using Virtual Machines for your application, see Moving from VM Role to Windows Azure Virtual Machines.
After you create or change the server image, you are ready to upload the .vhd file that contains the image data to Windows Azure. There are two opportunities for uploading VHDs to Windows Azure. When you initially create a VM Role, you upload a base VHD to Windows Azure, which is used as a template to create VM Role instances. For more information about creating the base VHD, see Create a Server Image for a VM Role in Windows Azure. After a period of time, you may need to make changes to the VM Role instances. To do this, you upload a differencing VHD. For more information, see Change the Server Image for a VM Role in Windows Azure.
You use the CSUpload Command-Line Tool to upload the base VHD or differencing VHD to Windows Azure. You must know the subscription identifier and the management certificate thumbprint to upload the .vhd file. You can find the subscription identifier in the Properties page for the subscription in the Windows Azure Management Portal. You can also find the certificate thumbprint in the Management Portal.
Important |
|---|
| You must run CSUpload only once per VHD. It is possible to start multiple simultaneous uploads of the same VHD using CSUpload, but the processes will not finish correctly. |
You need the subscription identifier to upload the VHD. You can copy and paste the information from the Management Portal to the command line.
Note |
|---|
| Before you start this procedure, you must have added a management certificate to the portal to upload a VHD. For more information, see Use Certificates With a VM Role in Windows Azure. |
-
Log on to the Management Portal.
-
Click Hosted Services, Storage Accounts & CDN, and then click Management Certificates.
-
In the Properties pane, you can find the certificate thumbprint under Thumbprint. The subscription identifier is under Subscription ID.
After you obtain the certificate thumbprint and the subscription identifier, you can upload the VHD.
-
Open a Windows Azure SDK Command Prompt window as an administrator.
-
Change the directory to where you saved the VHD.
-
Set the connection string by using the following command and replacing SubscriptionId and CertThumbprint with the values from your subscription:
csupload Set-Connection "SubscriptionId=SubscriptionId;CertificateThumbprint=CertThumbprint;ServiceManagementEndpoint=https://management.core.windows.net"
Note The certificate that you use must be installed in the certificate store. -
Upload the VHD by using the following command and replacing the VHD file name and displayed name:
csupload Add-StatelessVMImage –LiteralPath VHDName.vhd –Location LocationValue –Name DisplayedNameInPortal
Note The –LiteralPath and the –Location or the –AffinityGroup parameters are required, the –Name parameter is optional. The location or affinity group must match the location or affinity group that was defined for the corresponding cloud service. -
A dialog box for the Windows Azure VHD Verification Tool is displayed. This tool verifies that the operating system is in the proper state to be uploaded to Windows Azure. Click OK to continue the uploading process.
Note If you want to automate the uploading of a VHD, you can use the –SkipVerify parameter for Add-VMImage to skip the verification step and suppress the dialog box.
You will see the VHD displayed under VM Images in the portal using the display name that you provided when you uploaded the VHD.
See Also
Important