I'm trying to deploy VM Scale Set via the Azure python SDK.
When I'm trying to create the scale set an exception is thrown:
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
I'm creating the VM scale set via this code snippet:
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',
When you create the Azure VM Scale Set, the NIC should be an object of VirtualMachineScaleSetVMProfile. And the VirtualMachineScaleSetNetworkProfile must contains a list of the NIC configurations. The NIC number dependant on your VM Scale Set capacity.
Then all the Azure VM Scale Set functions here. Hope this will help you. Any more question please give me the message.