- Package Name: azure.mgmt.compute
- Package Version: v2020_06_01
- Operating System: ubuntu 18.04
- Python Version: Python 3.7
Describe the bug
Instead of creating the disk it throws Message: Required parameter 'hyperVGeneration' is missing (null).
error.
To Reproduce Steps to reproduce the behavior:
- Run below code
compute_client = get_client_from_cli_profile(ComputeManagementClient)
async_creation = compute_client.images.create_or_update(
'7AQVDL2J',
'test',
{
'location': 'westeurope',
'storage_profile': {
'os_disk': {
'os_type': 'Linux',
'os_state': "Generalized",
'blob_uri': 'https://bg09.blob.core.windows.net/vm-images/non-existent.vhd',
'caching': "ReadWrite",
}
}
}
)
Expected behavior Disk should be created
Error
Traceback (most recent call last):
File "<stdin>", line 11, in <module>
File "/usr/local/lib/python3.7/dist-packages/azure/mgmt/compute/v2020_06_01/operations/_images_operations.py", line 125, in create_or_update
**operation_config
File "/usr/local/lib/python3.7/dist-packages/azure/mgmt/compute/v2020_06_01/operations/_images_operations.py", line 81, in _create_or_update_initial
raise exp
msrestazure.azure_exceptions.CloudError: Azure Error: InvalidParameter
Message: Required parameter 'hyperVGeneration' is missing (null).
Target: hyperVGeneration
Link to git issue: https://github.com/Azure/azure-sdk-for-python/issues/12762
If anyone found a workaround for this, please share....
I can reproduce your issue, to fix it, we need to add a
hyper_vgeneration
when you creating the image.You could refer to the sample below, it works fine on my side.