本主题介绍如何使用 Azure PowerShell 在 Azure Marketplace 中查找 VM 映像。 创建 Windows VM 时使用此信息来指定 Marketplace 映像。
确保已安装并配置最新的Azure PowerShell 模块。
常用 Windows 映像表
PublisherName产品SKU
MicrosoftWindowsServerWindowsServer2016-Datacenter
MicrosoftWindowsServerWindowsServer2016-Datacenter-Server-Core
MicrosoftWindowsServerWindowsServer2016-Datacenter-with-Containers
MicrosoftWindowsServerWindowsServer2016-Nano-Server
MicrosoftWindowsServerWindowsServer2012-R2-Datacenter
MicrosoftWindowsServerWindowsServer2008-R2-SP1
MicrosoftDynamicsNAVDynamicsNAV2017
MicrosoftSharePointMicrosoftSharePointServer2016
MicrosoftSQLServerSQL2016-WS2016Enterprise
MicrosoftSQLServerSQL2014SP2-WS2012R2Enterprise
MicrosoftWindowsServerHPCPackWindowsServerHPCPack2012R2
MicrosoftWindowsServerEssentialsWindowsServerEssentialsWindowsServerEssentials
查找特定映像
使用 Azure Resource Manager 创建新的虚拟机时,在某些情况下,需要使用以下映像属性组合来指定映像:
发布者
产品
SKU
例如,将这些值用于Set-AzureRMVMSourceImagePowerShell cmdlet 或资源组模板,必须在此资源组模板中指定要创建的 VM 类型。
如果需要确定这些值,可以运行Get-AzureRMVMImagePublisher、Get-AzureRMVMImageOffer和Get-AzureRMVMImageSkucmdlet 来导航映像。 确定这些值:
列出映像发布者。
对于给定的发布者,列出其产品。
对于给定的产品,列出其 SKU。
首先,使用以下命令列出发布者:
PowerShell复制
$locName=""Get-AzureRMVMImagePublisher-Location$locName| Select PublisherName
填写选择的发布者名称,并运行以下命令:
PowerShell复制
$pubName=""Get-AzureRMVMImageOffer-Location$locName-Publisher$pubName| Select Offer
填写选择的产品名称,并运行以下命令:
PowerShell复制
$offerName=""Get-AzureRMVMImageSku-Location$locName-Publisher$pubName-Offer$offerName| Select Skus
从Get-AzureRMVMImageSku命令的输出,可获得为新虚拟机指定映像所需的所有信息。
下面是一个完整示例:
PowerShell复制
$locName="China North"Get-AzureRMVMImagePublisher-Location$locName| Select PublisherName
输出:
复制
PublisherName
-------------
a10networks
aiscaler-cache-control-ddos-and-url-rewriting-
alertlogic
AlertLogic.Extension
Barracuda.Azure.ConnectivityAgent
barracudanetworks
basho
boxless
bssw
Canonical
...
对于“MicrosoftWindowsServer”发布者:
PowerShell复制
$pubName="MicrosoftWindowsServer"Get-AzureRMVMImageOffer-Location$locName-Publisher$pubName| Select Offer
输出:
复制
Offer
-----
Windows-HUB
WindowsServer
WindowsServer-HUB
对于“WindowsServer”产品:
PowerShell复制
$offerName="WindowsServer"Get-AzureRMVMImageSku-Location$locName-Publisher$pubName-Offer$offerName| Select Skus
输出:
复制
Skus
----
2008-R2-SP1
2008-R2-SP1-zhcn
2008-R2-SP1-smalldisk
2012-Datacenter
2012-Datacenter-zhcn
2012-Datacenter-smalldisk
2012-R2-Datacenter
2012-R2-Datacenter-smalldisk
2016-Datacenter
2016-Datacenter-Server-Core
2016-Datacenter-Server-Core-smalldisk
2016-Datacenter-smalldisk
2016-Datacenter-with-Containers
2016-Nano-Server
从上面的列表中复制选择的 SKU 名称,已获得Set-AzureRMVMSourceImagePowerShell cmdlet 或资源组模板的所有信息。
后续步骤
现在,可以确切地选择想要使用的映像。 若要使用刚找到的映像信息快速创建虚拟机,请参阅使用 PowerShell 创建 Windows 虚拟机。
立即访问http://market.azure.cn
网友评论