Skip to content

Conversation

@olegbbtr
Copy link
Contributor

@olegbbtr olegbbtr commented Mar 5, 2025

This allows us to:

  1. Assure only one VMMigration object works with a VM.
  2. Handle a failure to simultaneously update both VM and VMM.

@github-actions
Copy link

github-actions bot commented Mar 5, 2025

No changes to the coverage.

HTML Report

Click to open

@olegbbtr olegbbtr changed the title neonvm-controller: fix state transitions neonvm-controller: set MigrationName on a VM Mar 5, 2025
olegbbtr added 3 commits March 6, 2025 21:50
This allows us to resolve conflicts between different migrations trying
to work with the same VM.

Signed-off-by: Oleg Vasilev <[email protected]>
Not a functional change, makes code simpler.

Signed-off-by: Oleg Vasilev <[email protected]>
@olegbbtr olegbbtr force-pushed the oleg/05-migration-logic branch from 8b31e33 to 8479225 Compare March 6, 2025 22:03
@olegbbtr olegbbtr requested review from petuhovskiy and sharnoff March 6, 2025 22:27
Copy link
Contributor

@sharnoff sharnoff left a comment

Choose a reason for hiding this comment

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

A couple questions

}
return &vm, nil
// return err and try reconcile again
return ctrl.Result{}, err
Copy link
Contributor

Choose a reason for hiding this comment

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

question(blocking): Given that if err != nil always ends in returning here, does that mean that we never remove the finalizer, and so the migration object cannot be deleted if the VM doesn't exist?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's true, and this problem existed before this PR. Let me think about a solution.

return r.updateMigrationStatus(ctx, migration)
if vm.Status.MigrationName == "" {
if vm.Status.Phase != vmv1.VmRunning {
// VM must be scaling, so we will try again in a second
Copy link
Contributor

Choose a reason for hiding this comment

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

question:

VM must be scaling

Why?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's an evolution of the // some other VM status (Scaling may be), requeue after second

But I agree, "may be" should not have turned into must be.

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