我正在使用 python 脚本来创建虚拟机。我能够创建虚拟机。只是想添加可用性集功能。
<<一些片段>>
resource_client = ResourceManagementClient(credentials, subscription_id)
compute_client = ComputeManagementClient(credentials, subscription_id)
storage_client = StorageManagementClient(credentials, subscription_id)
network_client = NetworkManagementClient(credentials, subscription_id)
# 创建资源组 print('\nCreate Resource Group') resource_client.resource_groups.create_or_update(GROUP_NAME, {'location':LOCATION})
# Create a storage account
print('\nCreate a storage account')
storage_async_operation = storage_client.storage_accounts.create(
GROUP_NAME,
STORAGE_ACCOUNT_NAME,
{
'sku': {'name': 'standard_lrs'},
'kind': 'storage',
'location': LOCATION
}
)
storage_async_operation.wait()
# Create a NIC
nic = create_nic(network_client)
<<>>
只是寻找可以创建可用性集的功能。我可以附加到多个虚拟机