你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Microsoft.ConnectedVMwarevSphere virtualMachines

Bicep 资源定义

可以使用面向以下操作部署 virtualMachines 资源类型:

有关每个 API 版本中已更改属性的列表,请参阅 更改日志

资源格式

若要创建 Microsoft.ConnectedVMwarevSphere/virtualMachines 资源,请将以下 Bicep 添加到模板。

resource symbolicname 'Microsoft.ConnectedVMwarevSphere/virtualMachines@2022-07-15-preview' = {
  name: 'string'
  location: 'string'
  tags: {
    tagName1: 'tagValue1'
    tagName2: 'tagValue2'
  }
  kind: 'string'
  extendedLocation: {
    name: 'string'
    type: 'string'
  }
  identity: {
    type: 'string'
  }
  properties: {
    firmwareType: 'string'
    guestAgentProfile: {
      clientPublicKey: 'string'
    }
    hardwareProfile: {
      memorySizeMB: int
      numCoresPerSocket: int
      numCPUs: int
    }
    inventoryItemId: 'string'
    moRefId: 'string'
    networkProfile: {
      networkInterfaces: [
        {
          deviceKey: int
          ipSettings: {
            allocationMethod: 'string'
            dnsServers: [
              'string'
            ]
            gateway: [
              'string'
            ]
            ipAddress: 'string'
            subnetMask: 'string'
          }
          name: 'string'
          networkId: 'string'
          nicType: 'string'
          powerOnBoot: 'string'
        }
      ]
    }
    osProfile: {
      adminPassword: 'string'
      adminUsername: 'string'
      computerName: 'string'
      guestId: 'string'
      linuxConfiguration: {
        patchSettings: {
          assessmentMode: 'string'
          patchMode: 'string'
        }
      }
      osType: 'string'
      windowsConfiguration: {
        patchSettings: {
          assessmentMode: 'string'
          patchMode: 'string'
        }
      }
    }
    placementProfile: {
      clusterId: 'string'
      datastoreId: 'string'
      hostId: 'string'
      resourcePoolId: 'string'
    }
    resourcePoolId: 'string'
    securityProfile: {
      uefiSettings: {
        secureBootEnabled: bool
      }
    }
    smbiosUuid: 'string'
    storageProfile: {
      disks: [
        {
          controllerKey: int
          deviceKey: int
          deviceName: 'string'
          diskMode: 'string'
          diskSizeGB: int
          diskType: 'string'
          name: 'string'
          unitNumber: int
        }
      ]
    }
    templateId: 'string'
    vCenterId: 'string'
  }
}

属性值

virtualMachines

名称 说明
name 资源名称 字符串 (必需)
location 获取或设置位置。 字符串 (必需)
标记 获取或设置资源标记。 标记名称和值的字典。 请参阅 模板中的标记
kind 门户/工具等用于呈现相同类型资源的不同 UX 体验的元数据;例如,ApiApps 是一种 Microsoft.Web/sites 类型。 如果受支持,资源提供程序必须验证并保留此值。 string
extendedLocation 获取或设置扩展位置。 ExtendedLocation
identity 资源的标识。 标识
properties 资源属性。 VirtualMachineProperties (必需)

ExtendedLocation

名称 说明
name 扩展的位置名称。 字符串
type 扩展位置类型。 字符串

标识

名称 说明 Value
type 托管服务标识的类型。 “None”
“SystemAssigned” (必需)

VirtualMachineProperties

名称 说明
firmwareType 固件类型 “bios”
'efi'
guestAgentProfile 来宾代理状态属性。 GuestAgentProfile
hardwareProfile 硬件属性。 HardwareProfile
inventoryItemId 获取或设置虚拟机的清单项 ID。 string
moRefId 获取或设置虚拟机的 vCenter MoRef (托管对象引用) ID。 字符串
networkProfile 网络属性。 NetworkProfile
osProfile OS 属性。 OsProfile
placementProfile 放置属性。 PlacementProfile
resourcePoolId 获取或设置此虚拟机将基于的 resourcePool 资源的 ARM ID
部署。
string
securityProfile 获取安全配置文件。 SecurityProfile
smbiosUuid 获取或设置 VM 的 SMBIOS UUID。 字符串
storageProfile 存储属性。 StorageProfile
templateId 获取或设置要部署虚拟机的模板资源的 ARM ID。 字符串
vCenterId 获取或设置此资源池所在的 vCenter 资源的 ARM ID。 string

GuestAgentProfile

名称 说明
clientPublicKey 获取或设置客户端提供的用于启用来宾管理的公钥。 字符串

HardwareProfile

名称 说明
memorySizeMB 获取或设置 VM 的内存大小(以 MB 为单位)。 int
numCoresPerSocket 获取或设置 VM 的每个套接字的核心数。 如果未指定,则默认为 1。 int
numCPU 获取或设置 vm 的 vCPU 数。 int

NetworkProfile

名称 说明
networkInterfaces 获取或设置与虚拟机关联的网络接口的列表。 NetworkInterface[]

NetworkInterface

名称 说明
deviceKey 获取或设置设备密钥值。 int
ipSettings 获取或设置 ipsettings。 NicIPSettings
name 获取或设置网络接口的名称。 string
networkId 获取或设置用于连接虚拟机的网络资源的 ARM ID。 string
nicType NIC 类型 'e1000'
'e1000e'
“pcnet32”
“vmxnet”
“vmxnet2”
“vmxnet3”
powerOnBoot 获取或设置启动时的电源。 'disabled'
'enabled'

NicIPSettings

名称 说明
allocationMethod 获取或设置 nic 分配方法。 'dynamic'
'linklayer'
'other'
“random”
'static'
“unset”
dnsServers 获取或设置 dns 服务器。 string[]
gateway 获取或设置网关。 string[]
ipAddress 获取或设置 nic 的 IP 地址。 字符串
subnetMask 获取或设置掩码。 string

OsProfile

名称 说明
adminPassword 获取或设置管理员密码。 字符串
adminUsername 获取或设置管理员用户名。 字符串
computerName 获取或设置计算机名称。 字符串
guestId 获取或设置 guestId。 string
linuxConfiguration 指定更新管理的 linux 配置。 OsProfileLinuxConfiguration
osType 获取或设置 os 的类型。 'Linux'
“其他”
“Windows”
windowsConfiguration 指定更新管理的 Windows 配置。 OsProfileWindowsConfiguration

OsProfileLinuxConfiguration

名称 说明
patchSettings 指定修补程序设置。 PatchSettings

PatchSettings

名称 说明
assessmentMode 指定评估模式。 字符串
patchMode 指定修补模式。 字符串

OsProfileWindowsConfiguration

名称 说明
patchSettings 指定修补程序设置。 PatchSettings

PlacementProfile

名称 说明
clusterId 获取或设置此虚拟机将部署的群集资源的 ARM ID。 字符串
datastoreId 获取或设置将保留虚拟机数据的数据存储资源的 ARM ID。 string
hostId 获取或设置此虚拟机将部署的主机资源的 ARM ID。 string
resourcePoolId 获取或设置此虚拟机将部署的 resourcePool 资源的 ARM ID。 字符串

SecurityProfile

名称 说明
uefiSettings 指定创建虚拟机时使用的安全设置,例如安全启动。 UefiSettings

UefiSettings

名称 说明
secureBootEnabled 指定是否应在虚拟机上启用安全启动。 bool

StorageProfile

名称 说明
disks 获取或设置与虚拟机关联的虚拟磁盘的列表。 VirtualDisk[]

VirtualDisk

名称 说明
controllerKey 获取或设置控制器 ID。 int
deviceKey 获取或设置设备密钥值。 int
deviceName 获取或设置设备名称。 字符串
diskMode 获取或设置磁盘模式。 “independent_nonpersistent”
“independent_persistent”
“persistent”
diskSizeGB 获取或设置磁盘总大小。 int
diskType 获取或设置磁盘支持类型。 “flat”
'pmem'
“rawphysical”
“rawvirtual”
'sesparse'
“稀疏”
“unknown”
name 获取或设置虚拟磁盘的名称。 string
unitNumber 获取或设置控制器上磁盘的单位号。 int

ARM 模板资源定义

可以使用面向以下操作部署 virtualMachines 资源类型:

有关每个 API 版本中已更改属性的列表,请参阅 更改日志

资源格式

若要创建 Microsoft.ConnectedVMwarevSphere/virtualMachines 资源,请将以下 JSON 添加到模板。

{
  "type": "Microsoft.ConnectedVMwarevSphere/virtualMachines",
  "apiVersion": "2022-07-15-preview",
  "name": "string",
  "location": "string",
  "tags": {
    "tagName1": "tagValue1",
    "tagName2": "tagValue2"
  },
  "kind": "string",
  "extendedLocation": {
    "name": "string",
    "type": "string"
  },
  "identity": {
    "type": "string"
  },
  "properties": {
    "firmwareType": "string",
    "guestAgentProfile": {
      "clientPublicKey": "string"
    },
    "hardwareProfile": {
      "memorySizeMB": "int",
      "numCoresPerSocket": "int",
      "numCPUs": "int"
    },
    "inventoryItemId": "string",
    "moRefId": "string",
    "networkProfile": {
      "networkInterfaces": [
        {
          "deviceKey": "int",
          "ipSettings": {
            "allocationMethod": "string",
            "dnsServers": [ "string" ],
            "gateway": [ "string" ],
            "ipAddress": "string",
            "subnetMask": "string"
          },
          "name": "string",
          "networkId": "string",
          "nicType": "string",
          "powerOnBoot": "string"
        }
      ]
    },
    "osProfile": {
      "adminPassword": "string",
      "adminUsername": "string",
      "computerName": "string",
      "guestId": "string",
      "linuxConfiguration": {
        "patchSettings": {
          "assessmentMode": "string",
          "patchMode": "string"
        }
      },
      "osType": "string",
      "windowsConfiguration": {
        "patchSettings": {
          "assessmentMode": "string",
          "patchMode": "string"
        }
      }
    },
    "placementProfile": {
      "clusterId": "string",
      "datastoreId": "string",
      "hostId": "string",
      "resourcePoolId": "string"
    },
    "resourcePoolId": "string",
    "securityProfile": {
      "uefiSettings": {
        "secureBootEnabled": "bool"
      }
    },
    "smbiosUuid": "string",
    "storageProfile": {
      "disks": [
        {
          "controllerKey": "int",
          "deviceKey": "int",
          "deviceName": "string",
          "diskMode": "string",
          "diskSizeGB": "int",
          "diskType": "string",
          "name": "string",
          "unitNumber": "int"
        }
      ]
    },
    "templateId": "string",
    "vCenterId": "string"
  }
}

属性值

virtualMachines

名称 说明 Value
type 资源类型 “Microsoft.ConnectedVMwarevSphere/virtualMachines”
apiVersion 资源 API 版本 '2022-07-15-preview'
name 资源名称 字符串 (必需)
location 获取或设置位置。 字符串 (必需)
标记 获取或设置资源标记。 标记名称和值的字典。 请参阅 模板中的标记
kind 门户/工具等用于呈现相同类型资源的不同 UX 体验的元数据;例如,ApiApps 是一种 Microsoft.Web/sites 类型。 如果受支持,资源提供程序必须验证并保留此值。 string
extendedLocation 获取或设置扩展位置。 ExtendedLocation
identity 资源的标识。 标识
properties 资源属性。 VirtualMachineProperties (必需)

ExtendedLocation

名称 说明
name 扩展的位置名称。 string
type 扩展位置类型。 string

标识

名称 说明 Value
type 托管服务标识的类型。 “None”
“SystemAssigned” (必需)

VirtualMachineProperties

名称 说明
firmwareType 固件类型 “bios”
'efi'
guestAgentProfile 来宾代理状态属性。 GuestAgentProfile
hardwareProfile 硬件属性。 HardwareProfile
inventoryItemId 获取或设置虚拟机的清单项 ID。 字符串
moRefId 获取或设置虚拟机的 vCenter MoRef (托管对象引用) ID。 字符串
networkProfile 网络属性。 NetworkProfile
osProfile OS 属性。 OsProfile
placementProfile 放置属性。 PlacementProfile
resourcePoolId 获取或设置此虚拟机将基于的 resourcePool 资源的 ARM ID
部署。
字符串
securityProfile 获取安全配置文件。 SecurityProfile
smbiosUuid 获取或设置 VM 的 SMBIOS UUID。 字符串
storageProfile 存储属性。 StorageProfile
templateId 获取或设置用于部署虚拟机的模板资源的 ARM ID。 字符串
vCenterId 获取或设置此资源池所在的 vCenter 资源的 ARM ID。 字符串

GuestAgentProfile

名称 说明
clientPublicKey 获取或设置客户端提供的用于启用来宾管理的公钥。 字符串

HardwareProfile

名称 说明
memorySizeMB 获取或设置 VM 的内存大小(以 MB 为单位)。 int
numCoresPerSocket 获取或设置 vm 的每个套接字的核心数。 如果未指定,则默认为 1。 int
numCPU 获取或设置 vm 的 vCPU 数。 int

NetworkProfile

名称 说明
networkInterfaces 获取或设置与虚拟机关联的网络接口列表。 NetworkInterface[]

NetworkInterface

名称 说明
deviceKey 获取或设置设备密钥值。 int
ipSettings 获取或设置 ipsettings。 NicIPSettings
name 获取或设置网络接口的名称。 字符串
networkId 获取或设置用于连接虚拟机的网络资源的 ARM ID。 字符串
nicType NIC 类型 “e1000”
“e1000e”
“pcnet32”
“vmxnet”
“vmxnet2”
“vmxnet3”
powerOnBoot 获取或设置启动时的电源。 “disabled”
“enabled”

NicIPSettings

名称 说明
allocationMethod 获取或设置 nic 分配方法。 “dynamic”
“linklayer”
“其他”
“random”
“static”
“unset”
dnsServers 获取或设置 dns 服务器。 string[]
gateway 获取或设置网关。 string[]
ipAddress 获取或设置 nic 的 IP 地址。 string
subnetMask 获取或设置掩码。 字符串

OsProfile

名称 说明
adminPassword 获取或设置管理员密码。 字符串
adminUsername 获取或设置管理员用户名。 字符串
computerName 获取或设置计算机名称。 字符串
guestId 获取或设置 guestId。 字符串
linuxConfiguration 指定更新管理的 linux 配置。 OsProfileLinuxConfiguration
osType 获取或设置 os 的类型。 “Linux”
“其他”
“Windows”
windowsConfiguration 指定更新管理的 Windows 配置。 OsProfileWindowsConfiguration

OsProfileLinuxConfiguration

名称 说明
patchSettings 指定修补程序设置。 PatchSettings

PatchSettings

名称 说明
assessmentMode 指定评估模式。 字符串
patchMode 指定修补模式。 字符串

OsProfileWindowsConfiguration

名称 说明
patchSettings 指定修补程序设置。 PatchSettings

PlacementProfile

名称 说明
clusterId 获取或设置此虚拟机将部署的群集资源的 ARM ID。 字符串
datastoreId 获取或设置将保留虚拟机数据的数据存储资源的 ARM ID。 字符串
hostId 获取或设置此虚拟机将部署的主机资源的 ARM ID。 字符串
resourcePoolId 获取或设置此虚拟机将部署的 resourcePool 资源的 ARM ID。 字符串

SecurityProfile

名称 说明
uefiSettings 指定创建虚拟机时使用的安全设置,例如安全启动。 UefiSettings

UefiSettings

名称 说明
secureBootEnabled 指定是否应在虚拟机上启用安全启动。 bool

StorageProfile

名称 说明
disks 获取或设置与虚拟机关联的虚拟磁盘列表。 VirtualDisk[]

VirtualDisk

名称 说明
controllerKey 获取或设置控制器 ID。 int
deviceKey 获取或设置设备密钥值。 int
deviceName 获取或设置设备名称。 字符串
diskMode 获取或设置磁盘模式。 “independent_nonpersistent”
“independent_persistent”
“persistent”
diskSizeGB 获取或设置磁盘总大小。 int
diskType 获取或设置磁盘支持类型。 “flat”
“pmem”
“原始物理”
“rawvirtual”
'sesparse'
“稀疏”
“unknown”
name 获取或设置虚拟磁盘的名称。 字符串
unitNumber 获取或设置控制器上磁盘的单位号。 int

Terraform (AzAPI 提供程序) 资源定义

virtualMachines 资源类型可以通过针对以下操作进行部署:

  • 资源组

有关每个 API 版本中更改的属性的列表,请参阅 更改日志

资源格式

若要创建 Microsoft.ConnectedVMwarevSphere/virtualMachines 资源,请将以下 Terraform 添加到模板。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.ConnectedVMwarevSphere/virtualMachines@2022-07-15-preview"
  name = "string"
  location = "string"
  parent_id = "string"
  tags = {
    tagName1 = "tagValue1"
    tagName2 = "tagValue2"
  }
  identity {
    type =  "SystemAssigned"
  }
  body = jsonencode({
    properties = {
      firmwareType = "string"
      guestAgentProfile = {
        clientPublicKey = "string"
      }
      hardwareProfile = {
        memorySizeMB = int
        numCoresPerSocket = int
        numCPUs = int
      }
      inventoryItemId = "string"
      moRefId = "string"
      networkProfile = {
        networkInterfaces = [
          {
            deviceKey = int
            ipSettings = {
              allocationMethod = "string"
              dnsServers = [
                "string"
              ]
              gateway = [
                "string"
              ]
              ipAddress = "string"
              subnetMask = "string"
            }
            name = "string"
            networkId = "string"
            nicType = "string"
            powerOnBoot = "string"
          }
        ]
      }
      osProfile = {
        adminPassword = "string"
        adminUsername = "string"
        computerName = "string"
        guestId = "string"
        linuxConfiguration = {
          patchSettings = {
            assessmentMode = "string"
            patchMode = "string"
          }
        }
        osType = "string"
        windowsConfiguration = {
          patchSettings = {
            assessmentMode = "string"
            patchMode = "string"
          }
        }
      }
      placementProfile = {
        clusterId = "string"
        datastoreId = "string"
        hostId = "string"
        resourcePoolId = "string"
      }
      resourcePoolId = "string"
      securityProfile = {
        uefiSettings = {
          secureBootEnabled = bool
        }
      }
      smbiosUuid = "string"
      storageProfile = {
        disks = [
          {
            controllerKey = int
            deviceKey = int
            deviceName = "string"
            diskMode = "string"
            diskSizeGB = int
            diskType = "string"
            name = "string"
            unitNumber = int
          }
        ]
      }
      templateId = "string"
      vCenterId = "string"
    }
    kind = "string"
    extendedLocation = {
      name = "string"
      type = "string"
    }
  })
}

属性值

virtualMachines

名称 说明 Value
type 资源类型 “Microsoft.ConnectedVMwarevSphere/virtualMachines@2022-07-15-preview”
name 资源名称 字符串 (必需)
location 获取或设置位置。 字符串 (必需)
parent_id 若要部署到资源组,请使用该资源组的 ID。 字符串 (必需)
标记 获取或设置资源标记。 标记名称和值的字典。
kind 门户/工具等用于呈现相同类型资源的不同 UX 体验的元数据;例如,ApiApps 是一种 Microsoft.Web/sites 类型。 如果支持,资源提供程序必须验证并保留此值。 string
extendedLocation 获取或设置扩展位置。 ExtendedLocation
identity 资源的标识。 标识
properties 资源属性。 VirtualMachineProperties (必需)

ExtendedLocation

名称 说明
name 扩展位置名称。 字符串
type 扩展位置类型。 字符串

标识

名称 说明 Value
type 托管服务标识的类型。 “SystemAssigned” (必需)

VirtualMachineProperties

名称 说明
firmwareType 固件类型 “bios”
“efi”
guestAgentProfile 来宾代理状态属性。 GuestAgentProfile
hardwareProfile 硬件属性。 HardwareProfile
inventoryItemId 获取或设置虚拟机的清单项 ID。 string
moRefId 获取或设置虚拟机的 vCenter MoRef (托管对象引用) ID。 字符串
networkProfile 网络属性。 NetworkProfile
osProfile OS 属性。 OsProfile
placementProfile 放置属性。 PlacementProfile
resourcePoolId 获取或设置此虚拟机将基于的 resourcePool 资源的 ARM ID
部署。
字符串
securityProfile 获取安全配置文件。 SecurityProfile
smbiosUuid 获取或设置 VM 的 SMBIOS UUID。 字符串
storageProfile 存储属性。 StorageProfile
templateId 获取或设置用于部署虚拟机的模板资源的 ARM ID。 字符串
vCenterId 获取或设置此资源池所在的 vCenter 资源的 ARM ID。 字符串

GuestAgentProfile

名称 说明
clientPublicKey 获取或设置客户端提供的用于启用来宾管理的公钥。 字符串

HardwareProfile

名称 说明
memorySizeMB 获取或设置 VM 的内存大小(以 MB 为单位)。 int
numCoresPerSocket 获取或设置 vm 的每个套接字的核心数。 如果未指定,则默认为 1。 int
numCPU 获取或设置 vm 的 vCPU 数。 int

NetworkProfile

名称 说明
networkInterfaces 获取或设置与虚拟机关联的网络接口列表。 NetworkInterface[]

NetworkInterface

名称 说明
deviceKey 获取或设置设备密钥值。 int
ipSettings 获取或设置 ipsettings。 NicIPSettings
name 获取或设置网络接口的名称。 字符串
networkId 获取或设置用于连接虚拟机的网络资源的 ARM ID。 字符串
nicType NIC 类型 “e1000”
“e1000e”
“pcnet32”
“vmxnet”
“vmxnet2”
“vmxnet3”
powerOnBoot 获取或设置启动时的电源。 "disabled"
"enabled"

NicIPSettings

名称 说明
allocationMethod 获取或设置 nic 分配方法。 “dynamic”
“linklayer”
“other”
“random”
“static”
“unset”
dnsServers 获取或设置 dns 服务器。 string[]
gateway 获取或设置网关。 string[]
ipAddress 获取或设置 nic 的 IP 地址。 字符串
subnetMask 获取或设置掩码。 字符串

OsProfile

名称 说明
adminPassword 获取或设置管理员密码。 字符串
adminUsername 获取或设置管理员用户名。 字符串
computerName 获取或设置计算机名称。 字符串
guestId 获取或设置 guestId。 字符串
linuxConfiguration 指定更新管理的 linux 配置。 OsProfileLinuxConfiguration
osType 获取或设置 os 的类型。 “Linux”
"Other"
“Windows”
windowsConfiguration 指定更新管理的 Windows 配置。 OsProfileWindowsConfiguration

OsProfileLinuxConfiguration

名称 说明
patchSettings 指定修补程序设置。 PatchSettings

PatchSettings

名称 说明
assessmentMode 指定评估模式。 字符串
patchMode 指定修补模式。 字符串

OsProfileWindowsConfiguration

名称 说明
patchSettings 指定修补程序设置。 PatchSettings

PlacementProfile

名称 说明
clusterId 获取或设置此虚拟机将部署的群集资源的 ARM ID。 string
datastoreId 获取或设置将保留虚拟机数据的数据存储资源的 ARM ID。 字符串
hostId 获取或设置此虚拟机将部署的主机资源的 ARM ID。 string
resourcePoolId 获取或设置此虚拟机将部署的 resourcePool 资源的 ARM ID。 字符串

SecurityProfile

名称 说明
uefiSettings 指定创建虚拟机时使用的安全设置,例如安全启动。 UefiSettings

UefiSettings

名称 说明
secureBootEnabled 指定是否应在虚拟机上启用安全启动。 bool

StorageProfile

名称 说明
disks 获取或设置与虚拟机关联的虚拟磁盘的列表。 VirtualDisk[]

VirtualDisk

名称 说明
controllerKey 获取或设置控制器 ID。 int
deviceKey 获取或设置设备密钥值。 int
deviceName 获取或设置设备名称。 字符串
diskMode 获取或设置磁盘模式。 “independent_nonpersistent”
“independent_persistent”
“persistent”
diskSizeGB 获取或设置磁盘总大小。 int
diskType 获取或设置磁盘支持类型。 “flat”
“pmem”
“原始物理”
“rawvirtual”
“sesparse”
“稀疏”
“未知”
name 获取或设置虚拟磁盘的名称。 字符串
unitNumber 获取或设置控制器上磁盘的单位号。 int