Skip to content

Latest commit

 

History

History
45 lines (33 loc) · 2.62 KB

File metadata and controls

45 lines (33 loc) · 2.62 KB

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.

##Remove a VM Image with PowerShell Run the below command to remove an uploaded VM image. After removal, tenants will no longer be able to deploy virtual machines with this image.

Remove-VMImage -publisher "Canonical" -offer "UbuntuServer" -sku "14.04.3-LTS" -version "1.0.0" -osType Linux -tenantID <mydirectory>.onmicrosoft.com

Note: This cmdlet does not remove any Marketplace item created as part of uploading a VM Image. These Marketplace items will need to be removed separately.