Skip to content

Remove AzureNodeSchema.hyperv_generation#3990

Merged
LiliDeng merged 4 commits intomainfrom
kameroncarr/hyperv_generation
Sep 9, 2025
Merged

Remove AzureNodeSchema.hyperv_generation#3990
LiliDeng merged 4 commits intomainfrom
kameroncarr/hyperv_generation

Conversation

@kamalca
Copy link
Collaborator

@kamalca kamalca commented Sep 3, 2025

There were three places where hyperv_generation were being tracked:

  • VhdGeneration / HyperVGeneration (Feature)
  • AzureNodeSchema (now removed)
  • AzureImageSchema

It makes sense to treat the VM capability as a feature, and to put the image capability in the image schema. This makes the third hyperv_generation redundant.

The name VhdGeneration doesn't make sense given it's purpose. This feature is populated with the Hyper-V Generations supported by the VM SKU.
@kamalca kamalca marked this pull request as ready for review September 4, 2025 03:24
@kamalca kamalca force-pushed the kameroncarr/hyperv_generation branch from 956fe0f to af74062 Compare September 4, 2025 17:28
There were three places where hyperv_generation were being tracked:
* VhdGeneration / HyperVGeneration (Feature)
* AzureNodeSchema (now removed)
* AzureImageSchema

It makes sense to treat the VM capability as a feature, and to put the image capability in the image schema. This makes the third hyperv_generation redundant.
Keep the image object and the _raw field in sync after making changes to the image object.
Keep the extended_runbook synced as well.
@kamalca kamalca force-pushed the kameroncarr/hyperv_generation branch from af74062 to 5645cbe Compare September 4, 2025 18:06
@kamalca kamalca requested a review from squirrelsc September 4, 2025 19:32
The goal of _resolve_marketplace_image is only to change "latest" to a real version, but the function is cached in a way that can lead to other fields being overwritten by old cached values.
@kamalca kamalca force-pushed the kameroncarr/hyperv_generation branch from 5645cbe to 221f113 Compare September 4, 2025 22:49
@squirrelsc
Copy link
Member

@LiliDeng LGTM

@LiliDeng
Copy link
Collaborator

LiliDeng commented Sep 8, 2025

@kamalca please make sure you have tested it. I saw

Traceback (most recent call last):
  File "C:\app\lsg-lisa\lisa\lisa\runners\lisa_runner.py", line 485, in _prepare_environment
    self.platform.prepare_environment(environment)
  File "C:\app\lsg-lisa\lisa\lisa\platform_.py", line 164, in prepare_environment
    is_success = self._prepare_environment(environment, log)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\app\lsg-lisa\lisa\lisa\sut_orchestrator\azure\platform_.py", line 542, in _prepare_environment
    self._set_image_features(req)
  File "C:\app\lsg-lisa\lisa\lisa\sut_orchestrator\azure\platform_.py", line 3066, in _set_image_features
    self._add_image_features(node_space)
  File "C:\app\lsg-lisa\lisa\lisa\sut_orchestrator\azure\platform_.py", line 2932, in _add_image_features
    azure_runbook = node_space.get_extended_runbook(AzureNodeSchema, AZURE)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\app\lsg-lisa\lisa\lisa\schema.py", line 111, in get_extended_runbook
    self._extended_runbook: T = load_by_type(
                                ^^^^^^^^^^^^^
  File "C:\app\lsg-lisa\lisa\lisa\schema.py", line 1692, in load_by_type
    result: T = schema_type.schema().load(raw_runbook, many=many)  # type: ignore
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python\Lib\site-packages\marshmallow\schema.py", line 792, in load
    return self._do_load(
           ^^^^^^^^^^^^^^
  File "C:\Python\Lib\site-packages\marshmallow\schema.py", line 999, in _do_load
    raise exc
marshmallow.exceptions.ValidationError: {'hyperv_generation': ['Unknown field.']}

@kamalca
Copy link
Collaborator Author

kamalca commented Sep 8, 2025

@LiliDeng Please test with main-ci branch

@LiliDeng LiliDeng merged commit a700fed into main Sep 9, 2025
53 checks passed
@LiliDeng LiliDeng deleted the kameroncarr/hyperv_generation branch September 9, 2025 03:09
Balashivaram pushed a commit to Balashivaram/lisa that referenced this pull request Sep 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants