Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 14, 2025

Completes the internal Python models by adding host resource configuration and all remaining VM properties from the vm properties checklist, enabling comprehensive inventory collection and authoritative API representation of resource state.

Phase 1: Host Resource Models

New Models

  • StorageClass - Maps storage class name to filesystem path
  • Network / VlanConfiguration - Maps network name to VLAN ID and virtual switch
  • HostResources - Aggregates storage classes, networks, and VM paths (matches Schemas/hostresources.json schema)
  • NetworkModel - Enum for network types (currently VLAN only)

Enhanced Models (Phase 1)

  • Host.resources (Optional[HostResources]) - Carries host resource configuration
  • VMDisk.storage_class (Optional[str]) - References storage class from host resources
  • VMNetworkAdapter.vlan_id (Optional[int]) - VLAN ID from network configuration (legacy vlan string field maintained for compatibility)

Phase 2: VM Extended Properties

New Enums

  • HostRecoveryAction - VM automatic start action after host recovery (none, resume, always-start)
  • HostStopAction - VM action when host stops (save, stop, shut-down)

Enhanced VM Model (15 new properties)

  • cluster - Cluster membership for failover configuration
  • dynamic_memory_buffer - Memory buffer percentage for dynamic memory
  • Security: secure_boot_enabled, secure_boot_template, trusted_platform_module_enabled, tpm_key_protector
  • Boot: primary_boot_device - Boot device configuration
  • Host Actions: host_recovery_action, host_stop_action - Automatic VM actions on host events
  • Integration Services (6 properties): integration_services_shutdown, integration_services_time, integration_services_data_exchange, integration_services_heartbeat, integration_services_vss_backup, integration_services_guest_services

Enhanced VMNetworkAdapter Model (6 new properties)

  • mac_address_config - MAC address configuration mode ("Dynamic" or "Static")
  • Security: dhcp_guard, router_guard, mac_spoof_guard
  • Bandwidth: min_bandwidth_mbps, max_bandwidth_mbps

Usage

# Host with resources
host = Host(
    hostname="hyperv-01.example.com",
    resources=HostResources(
        version=1,
        schema_name="hostresources",
        storage_classes=[
            StorageClass(name="fast-ssd", path="C:\\ClusterStorage\\Volume1")
        ],
        networks=[
            Network(
                name="Production",
                model=NetworkModel.VLAN,
                configuration=VlanConfiguration(
                    virtual_switch="External-Switch",
                    vlan_id=100
                )
            )
        ],
        virtual_machines_path="C:\\VirtualMachines"
    )
)

# VM with extended properties
vm = VM(
    name="production-vm-01",
    host="hyperv-01.example.com",
    cluster="production-cluster",
    state=VMState.RUNNING,
    secure_boot_enabled=True,
    host_recovery_action=HostRecoveryAction.ALWAYS_START,
    integration_services_shutdown=True
)

# Network adapter with extended properties
adapter = VMNetworkAdapter(
    network="Production",
    vlan_id=100,
    mac_address_config="Static",
    dhcp_guard=True,
    min_bandwidth_mbps=100
)

All fields are optional and maintain backward compatibility. Models support automatic Pydantic serialization for API use. Existing HostResourcesService handles loading configuration from hosts at C:\ProgramData\Aether-V\hostresources.{json,yaml}.

Testing

  • 63 total tests passing (19 host resources + 23 VM extended properties + 21 existing)
  • Comprehensive test coverage for all new properties
  • Backward compatibility validated

Documentation

  • server/docs/host_resources_models.md - Host resource configuration models
  • server/docs/vm_extended_properties.md - VM extended properties documentation
  • Updated Terraform/vm properties checklist - All properties now implemented in Python Model

The internal models are now complete and ready for inventory collection system extension.

Original prompt

please get started with the implementation. the key considerations will be keeping it compatible with the easy api via automatic model serialization and continueing to support incremental expansion. start with just expanding the models. do NOT move on to api, ui, or inventory yet. expand host models to store information about host resources. this will allow the model to match vlan ids to network names and storage paths to storage classes, etc. the point of this is to provide an authoritative api representing the state of resources and their configuration. Keep backend logic minimal, use enums where reasonable, referance #file:resource schema for information about how this will translate to terraform usage for hints as to model design. refer to #file:vm properties for tracking progress.

The user has attached the following file paths as relevant context:

  • Terraform/vm properties
  • Terraform/resource schema
[Chronological Review: The conversation began with the user requesting a review of internal Python models for VMs, NICs, and disks, specifically focusing on the properties and their alignment with the intended data model. The user emphasized the need for a well-planned model to support relationships among hosts, clusters, NICs, disks, and VMs. Following this, the user requested the implementation of model expansions, prioritizing compatibility with an easy API and incremental expansion, specifically starting with host models.]

[Intent Mapping:

  1. "can you review the internal python models for vms, nics. and disks..." - User requested a review of models and properties to ensure they support the intended data model.
  2. "please get started with the implementation..." - User instructed to begin implementation focusing on model expansion without moving to API, UI, or inventory yet.]

[Technical Inventory:

  • Python models for VMs, NICs, and disks.
  • Internal VM Object Model and Terraform object model for virtual machines.
  • Emphasis on automatic model serialization and incremental expansion.]

[Code Archaeology:

  • File: /workspaces/Aether-V/Terraform/vm properties - Contains a checklist for guiding development of the UI, API, and internal model.
  • File: /workspaces/Aether-V/Terraform/resource schema - Defines the Terraform object model for virtual machines.]

[Progress Assessment:

  • Completed: User has filled in the API column for properties.
  • Pending: Expansion of host models to store information about host resources.]

[Context Validation: All critical information for continuation is captured, including the need to expand models and maintain compatibility with the API.]

[Recent Commands Analysis:

  • Last Agent Commands: User requested a review of models and then instructed to start implementation focusing on model expansion.
  • Tool Results Summary: No specific tool results were generated as the conversation focused on user requests and instructions.
  • Pre-Summary State: The agent was actively discussing the implementation of model expansions when the token budget was exceeded.
  • Operation Context: The commands were executed to align the development process with the user's goals of creating a robust and expandable data model.]
1. Conversation Overview: - Primary Objectives: - "can you review the internal python models for vms, nics. and disks..." - Review models and properties for alignment with intended data model. - "please get started with the implementation..." - Begin implementation focusing on model expansion. - Session Context: The conversation transitioned from a review of existing models to a directive for implementation, emphasizing incremental expansion. - User Intent Evolution: The user shifted from seeking a review to requesting actionable steps for model expansion.
  1. Technical Foundation:
  • Python Models: Internal models for VMs, NICs, and disks.
  • Terraform Object Model: Interface for the Terraform provider, distinct from internal models.
  1. Codebase Status:
  • File Name 1: /workspaces/Aether-V/Terraform/vm properties
    • Purpose: Guide development of UI, API, and internal model.
    • Current State: Checklist for properties filled in by the user.
  • File Name 2: /workspaces/Aether-V/Terraform/resource schema
    • Purpose: Define Terraform object model for virtual machines.
    • Current State: Not explicitly modified in the conversation.
  1. Problem Resolution:
  • Issues Encountered: None explicitly stated, but the need for a well-structured model was highlighted.
  • Solutions Implemented: User provided a clear directive for model expansion.
  • Debugging Context: No ongoing troubleshooting mentioned.
  • Lessons Learned: Importance of aligning internal models with intended data relationships.
  1. Progress Tracking:
  • Completed Tasks: User filled in API properties.
  • Partially Complete Work: Expansion of host models is pending.
  • Validated Outcomes: None confirmed yet.
  1. Active Work State:
  • Current Focus: Expanding host models to store information ...

Created from VS Code.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI self-assigned this Dec 14, 2025
Copilot AI and others added 2 commits December 14, 2025 18:34
- Add StorageClass model for mapping storage class names to filesystem paths
- Add Network and VlanConfiguration models for mapping network names to VLAN IDs and virtual switches
- Add HostResources model to aggregate storage classes, networks, and VM paths
- Expand Host model to include optional resources field
- Add storage_class field to VMDisk model
- Add vlan_id field to VMNetworkAdapter model (keeping legacy vlan field for backward compatibility)
- Add NetworkModel enum for network types (currently only VLAN)
- All changes maintain backward compatibility
- Comprehensive test suite added in test_host_resources_models.py

Co-authored-by: charlespick <17918019+charlespick@users.noreply.github.com>
- Add comprehensive documentation in server/docs/host_resources_models.md
- Update vm properties checklist to mark storage_class and vlan_id as implemented in Python model and APIs
- Documentation covers all new models, usage examples, and API compatibility

Co-authored-by: charlespick <17918019+charlespick@users.noreply.github.com>
Copilot AI changed the title [WIP] Expand host models to store information about host resources Expand host models to store resource configuration Dec 14, 2025
Copilot AI requested a review from charlespick December 14, 2025 18:40
@charlespick
Copy link
Owner

@copilot review the remaining missing properties in Terraform/vm properties and add them as optional to the existing models to complete the internal models so we can extend the inventory collection system next

- Add cluster field to VM model for cluster membership
- Add dynamic_memory_buffer for memory buffer percentage configuration
- Add security settings (secure_boot_enabled, secure_boot_template, trusted_platform_module_enabled, tpm_key_protector)
- Add primary_boot_device for boot configuration
- Add HostRecoveryAction and HostStopAction enums
- Add host_recovery_action and host_stop_action fields for host action configuration
- Add integration services fields (shutdown, time, data_exchange, heartbeat, vss_backup, guest_services)
- Add VMNetworkAdapter security settings (dhcp_guard, router_guard, mac_spoof_guard)
- Add VMNetworkAdapter bandwidth settings (min_bandwidth_mbps, max_bandwidth_mbps)
- Add mac_address_config field for MAC address configuration mode
- Update vm properties checklist to mark all new properties as implemented
- Add comprehensive test suite with 23 tests (all passing)
- Add documentation for all extended properties
- All changes maintain backward compatibility (all new fields are optional)

Co-authored-by: charlespick <17918019+charlespick@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 14, 2025

@copilot review the remaining missing properties in Terraform/vm properties and add them as optional to the existing models to complete the internal models so we can extend the inventory collection sy...

Completed in commit badd05c. Added all remaining properties from the vm properties checklist:

VM Model (15 new properties):

  • cluster, dynamic_memory_buffer
  • Security: secure_boot_enabled, secure_boot_template, trusted_platform_module_enabled, tpm_key_protector
  • Boot: primary_boot_device
  • Host actions: host_recovery_action, host_stop_action (with HostRecoveryAction and HostStopAction enums)
  • Integration services: shutdown, time, data_exchange, heartbeat, vss_backup, guest_services

VMNetworkAdapter (6 new properties):

  • mac_address_config
  • Security: dhcp_guard, router_guard, mac_spoof_guard
  • Bandwidth: min_bandwidth_mbps, max_bandwidth_mbps

All properties are optional for backward compatibility. 23 new tests added (63 total passing). Documentation in server/docs/vm_extended_properties.md. The internal models are now complete for inventory collection system extension.

Copilot AI changed the title Expand host models to store resource configuration Complete internal models with host resources and VM extended properties Dec 14, 2025
@charlespick charlespick marked this pull request as ready for review December 14, 2025 18:53
@charlespick charlespick merged commit c63cb0a into Complete-vm-models Dec 14, 2025
10 checks passed
@charlespick charlespick deleted the copilot/expand-host-models-resources branch December 14, 2025 18:54
charlespick added a commit that referenced this pull request Dec 14, 2025
* Checklist

* Filled out and planned

* Complete internal models with host resources and VM extended properties (#235)

* Initial plan

* Expand host models with resource information

- Add StorageClass model for mapping storage class names to filesystem paths
- Add Network and VlanConfiguration models for mapping network names to VLAN IDs and virtual switches
- Add HostResources model to aggregate storage classes, networks, and VM paths
- Expand Host model to include optional resources field
- Add storage_class field to VMDisk model
- Add vlan_id field to VMNetworkAdapter model (keeping legacy vlan field for backward compatibility)
- Add NetworkModel enum for network types (currently only VLAN)
- All changes maintain backward compatibility
- Comprehensive test suite added in test_host_resources_models.py

Co-authored-by: charlespick <17918019+charlespick@users.noreply.github.com>

* Add documentation and update vm properties checklist

- Add comprehensive documentation in server/docs/host_resources_models.md
- Update vm properties checklist to mark storage_class and vlan_id as implemented in Python model and APIs
- Documentation covers all new models, usage examples, and API compatibility

Co-authored-by: charlespick <17918019+charlespick@users.noreply.github.com>

* Add extended properties to VM and VMNetworkAdapter models

- Add cluster field to VM model for cluster membership
- Add dynamic_memory_buffer for memory buffer percentage configuration
- Add security settings (secure_boot_enabled, secure_boot_template, trusted_platform_module_enabled, tpm_key_protector)
- Add primary_boot_device for boot configuration
- Add HostRecoveryAction and HostStopAction enums
- Add host_recovery_action and host_stop_action fields for host action configuration
- Add integration services fields (shutdown, time, data_exchange, heartbeat, vss_backup, guest_services)
- Add VMNetworkAdapter security settings (dhcp_guard, router_guard, mac_spoof_guard)
- Add VMNetworkAdapter bandwidth settings (min_bandwidth_mbps, max_bandwidth_mbps)
- Add mac_address_config field for MAC address configuration mode
- Update vm properties checklist to mark all new properties as implemented
- Add comprehensive test suite with 23 tests (all passing)
- Add documentation for all extended properties
- All changes maintain backward compatibility (all new fields are optional)

Co-authored-by: charlespick <17918019+charlespick@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: charlespick <17918019+charlespick@users.noreply.github.com>

* Clean up models

* fix mypy errors

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
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.

2 participants