我正在尝试通过 Azure python SDK 部署 VM Scale Set。
当我尝试创建规模集时,会引发异常:
Message: VM scale set network profile /subscriptions/subscription_id/resourceGroups/MatrixRG/providers/Microsoft.Compute/virtualMachineScaleSets/ScaleSetName/updateGroups/63e63aa7-0f01-42be-88fd-ada85c591967 has no network interface configurations
我正在通过此代码段创建 VM 规模集:
region_name = 'eastus'
sku = Sku(name='Standard_DS1_v2', capacity=5)
vmss_profile = VirtualMachineScaleSetVMProfile(storage_profile={
'image_reference':
{
'id': '/subscriptions/e500fb85-1759-463b-b828-0d4e0b38a305/resourceGroups/MatrixRG/'
'providers/Microsoft.Compute/images/libscapiImageEastUS'
}
},
os_profile={
'adminUsername': 'ubuntu',
'computerName': 'myVM',
'linux_configuration': {
'disable_password_authentication': True,
'ssh': {
'public_keys': [{
'path': '/home/ubuntu/.ssh/authorized_keys',
'key_data': key_data
}]
}
}
},
network_profile={
'network_interfaces': [{
'id': nic
}]
})
vmss = VirtualMachineScaleSet(region_name, sku=sku, virtual_machine_profile=vmss_profile,
upgrade_policy=upgrade_policy, single_placement_group=True)
response = self.compute_client.virtual_machine_scale_sets.create_or_update(self.resource_group, 'HyperMPC',