Microsoft.Compute.SizeSelector UI 元素Microsoft.Compute.SizeSelector UI element

一个用于为一个或多个虚拟机实例选择大小的控件。A control for selecting a size for one or more virtual machine instances.

UI 示例UI sample

用户会看到一个选择器,其中包含元素定义中的默认值。The user sees a selector with default values from the element definition.

Microsoft.Compute.SizeSelector

选择控件后,用户会看到可用大小的展开视图。After selecting the control, the user sees an expanded view of the available sizes.

展开的 Microsoft.Compute.SizeSelector

架构Schema

{
  "name": "element1",
  "type": "Microsoft.Compute.SizeSelector",
  "label": "Size",
  "toolTip": "",
  "recommendedSizes": [
    "Standard_D1",
    "Standard_D2",
    "Standard_D3"
  ],
  "constraints": {
    "allowedSizes": [],
    "excludedSizes": [],
    "numAvailabilityZonesRequired": 3,
    "zone": "3"
  },
  "options": {
    "hideDiskTypeFilter": false
  },
  "osPlatform": "Windows",
  "imageReference": {
    "publisher": "MicrosoftWindowsServer",
    "offer": "WindowsServer",
    "sku": "2012-R2-Datacenter"
  },
  "count": 2,
  "visible": true
}

示例输出Sample output

"Standard_D1"

备注Remarks

  • recommendedSizes 应至少有一个大小。recommendedSizes should have at least one size. 第一个建议的大小将用作默认值。The first recommended size is used as the default. 可用大小列表未按建议状态排序。The list of available sizes isn't sorted by the recommended state. 用户可以选择要按建议状态排序的列。The user can select that column to sort by recommended state.
  • 如果某个建议的大小在所选位置中不可用,则会自动跳过该大小。If a recommended size isn't available in the selected location, the size is automatically skipped. 而且将使用下一个建议的大小。Instead, the next recommended size is used.
  • constraints.allowedSizesconstraints.excludedSizes 都是可选的,并且不能同时使用。constraints.allowedSizes and constraints.excludedSizes are both optional, but can't be used simultaneously. 可以通过调用为订阅列出可用虚拟机大小来确定可用大小的列表。The list of available sizes can be determined by calling List available virtual machine sizes for a subscription. 将隐藏未在 constraints.allowedSizes 中指定的任何大小,会显示未在 constraints.excludedSizes 中指定的任何大小。Any size not specified in the constraints.allowedSizes is hidden, and any size not specified in constraints.excludedSizes is shown.
  • 必须指定 osPlatform,它可以是 WindowsLinuxosPlatform must be specified, and can be either Windows or Linux. 它用来确定虚拟机的硬件成本。It's used to determine the hardware costs of the virtual machines.
  • 对于第一方映像,将省略 imageReference,对于第三方映像,将提供此参数。imageReference is omitted for first-party images, but provided for third-party images. 它用来确定虚拟机的软件成本。It's used to determine the software costs of the virtual machines.
  • count 用来为元素设置合适的乘数。count is used to set the appropriate multiplier for the element. 它支持静态值(例如 2),也支持来自其他元素的动态值(例如 [steps('step1').vmCount])。It supports a static value, like 2, or a dynamic value from another element, like [steps('step1').vmCount]. 默认值是 1秒。The default value is 1.
  • numAvailabilityZonesRequired 可以是 1、2 或 3。The numAvailabilityZonesRequired can be 1, 2, or 3.
  • 默认情况下,hideDiskTypeFilter 为 false 。By default, hideDiskTypeFilter is false. 磁盘类型筛选器允许用户查看所有磁盘类型,或者只查看 SSD。The disk type filter enables the user to see all disk types or only SSD.

后续步骤Next steps