AzureStack-Tools/ComputeAdmin
Igor Sedukhin 5e128100c1 Merge pull request #8 from bgelens/master
Implemented fixes for Add-VMImage
2016-10-03 09:36:04 -07:00
..
Tests Added initial tests covering module import and parameter combination validation 2016-10-01 10:14:01 +02:00
AzureStack.ComputeAdmin.psm1 added validations for resource group, storage account and container presence when function starts (in case of script cancel / exception on earlier run), added VM Image already exist check and bail out if so, Changed write-host error messages and exit to write-error -erroraction stop for cancelled / failed download 2016-09-29 21:33:27 +02:00
CustomizedVMGalleryItem.azpkg VM Image Upload Tool changes 2016-09-23 15:50:03 -07:00
README.md Update README.md 2016-09-29 13:07:19 -07:00

README.md

Azure Stack Compute Administration

Instructions below are relative to the .\ComputeAdmin folder of the AzureStack-Tools repo.

Import-Module .\AzureStack.ComputeAdmin.psm1

##Add a VM image to the Marketplace with PowerShell

  1. Prepare a Windows or Linux operating system virtual hard disk image in VHD format (not VHDX).

  2. Add the VM image by invoking the Add-VMImage cmdlet.

    • Include the publisher, offer, SKU, and version for the VM image. These parameters are used by Azure Resource Manager templates that reference the VM image.
    • Specify osType as Windows or Linux.
    • Include your Azure Active Directory tenant ID in the form <mydirectory>.onmicrosoft.com.
    • The following is an example invocation of the script:
Add-VMImage -publisher "Canonical" -offer "UbuntuServer" -sku "14.04.3-LTS" -version "1.0.0" -osType Linux -osDiskLocalPath 'C:\Users\<me>\Desktop\UbuntuServer.vhd' -tenantID <mydirectory>.onmicrosoft.com

Note: The cmdlet requests credentials for adding the VM image. Provide the administrator Azure Active Directory credentials, such as <Admin Account>@<mydirectory>.onmicrosoft.com, to the prompt.

The command does the following:

  • Authenticates to the Azure Stack environment
  • Uploads the local VHD to a newly created temporary storage account
  • Adds the VM image to the VM image repository
  • Creates a Marketplace item

To verify that the command ran successfully, go to Marketplace in the portal, and then verify that the VM image is available in the Virtual Machines category.