azure-sdk-for-python icon indicating copy to clipboard operation
azure-sdk-for-python copied to clipboard

Message: Required parameter 'hyperVGeneration' is missing (null) while creating a Managed Disk image from blob storage

Open iamvishnuks opened this issue 6 years ago • 6 comments

  • 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:

  1. 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

iamvishnuks avatar Jul 28 '20 13:07 iamvishnuks

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Drewm3, @avirishuv.

ghost avatar Jul 28 '20 16:07 ghost

@Vaibhav-Agar is this something you could take a look at?

avirishuv avatar Jul 29 '20 18:07 avirishuv

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Drewm3, @vaibhav-agar.

ghost avatar Jul 29 '20 18:07 ghost

Investigating

Vaibhav-Agar avatar Jul 30 '20 21:07 Vaibhav-Agar

Investigating

I found a work around here But the mentioned git branch is no longer available

iamvishnuks avatar Aug 01 '20 17:08 iamvishnuks

async_creation = compute_client.images.create_or_update( rg_name, disk_name, { 'location': location, 'storage_profile': { 'os_disk': { 'os_type': 'Linux', 'os_state': "Generalized", 'blob_uri': uri, 'caching': "ReadWrite" } }, 'hyper_vgeneration': 'V1' } )

Added Hyper vgeneration version like this and issue got fixed.

iamvishnuks avatar Aug 05 '20 11:08 iamvishnuks