Skip to content

Conversation

@Kun483
Copy link
Collaborator

@Kun483 Kun483 commented Sep 15, 2025

  1. Prevent MAAS compose a LXD VM in a wrong zone or resourcePool when no available machines.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses an issue where MAAS was creating LXD VMs in incorrect zones for workload clusters. The fix adds validation to ensure allocated machines match the requested zone and resource pool constraints, releasing machines that don't meet requirements and returning an error.

  • Adds post-allocation validation for zone and resource pool constraints
  • Implements machine release logic when constraints are not met
  • Removes a debug log message for HCP control plane allocation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 5 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@AmitSahastra
Copy link
Contributor

We are adding post-allocation validation for zone and resource pool constraints, and removing the VM of it got created in a different resource pool/AZ. There is no logic to restrict the creation in the wrong placement.

Also, once we delete the out-of-place VM. Will it trigger the new VM creation? If so, will it honour the placement? WIll it lead to loop of OOP VM creation and deletion?

@Kun483
Copy link
Collaborator Author

Kun483 commented Sep 16, 2025

We are adding post-allocation validation for zone and resource pool constraints, and removing the VM of it got created in a different resource pool/AZ. There is no logic to restrict the creation in the wrong placement.

Also, once we delete the out-of-place VM. Will it trigger the new VM creation? If so, will it honour the placement? WIll it lead to loop of OOP VM creation and deletion?

Because this Allocator causes LXD VM creation in a wrong resource Pool or wrong zone, we can't control it. We won't triggered new VM creation.

@AmitSahastra
Copy link
Contributor

We are adding post-allocation validation for zone and resource pool constraints, and removing the VM of it got created in a different resource pool/AZ. There is no logic to restrict the creation in the wrong placement.
Also, once we delete the out-of-place VM. Will it trigger the new VM creation? If so, will it honour the placement? WIll it lead to loop of OOP VM creation and deletion?

Because this Allocator causes LXD VM creation in a wrong resource Pool or wrong zone, we can't control it. We won't trigger new VM creation.

In that case, we can take one of these approaches

  • Document the behaviour
  • Check if any flag or strict placement option is present in maas-client-go.
  • Before the allocator call, verify if host availability based on placement and error out if not found.

cc @snehala27

@Kun483
Copy link
Collaborator Author

Kun483 commented Sep 17, 2025

close it as this is MAAS default behavior

@Kun483 Kun483 closed this Sep 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants