Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --prepare option to migrate command #377

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nadvornik
Copy link
Contributor

What does this PR change?

This PR adds --prepare option to migrate command.
With this option, the migration does not stop the services on source server and ends after syncing
the data.

Test coverage

  • No tests: add explanation

  • No tests: already covered

  • Unit tests were added

  • DONE

Links

Issue(s): #181

  • DONE

Changelogs

Make sure the changelogs entries you are adding are compliant with https://github.com/uyuni-project/uyuni/wiki/Contributing#changelogs and https://github.com/uyuni-project/uyuni/wiki/Contributing#uyuni-projectuyuni-repository

If you don't need a changelog check, please mark this checkbox:

  • No changelog needed

If you uncheck the checkbox after the PR is created, you will need to re-run changelog_test (see below)

Before you merge

Check How to branch and merge properly!

Copy link
Contributor

@cbosdo cbosdo left a comment

Choose a reason for hiding this comment

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

LGTM, with some questions about whether to stop the services?

@@ -90,6 +90,11 @@ func migrateToKubernetes(
return utils.Errorf(err, L("cannot run migration"))
}

if flags.Prepare {
log.Info().Msg(L("Migration prepared. Run the 'migrate' command without '--prepare' to finish the migration."))
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we scale to 0 after this? Is the migration without --prepare coping well with the existing resources?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have to test the kubernetes part.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have added scale to 0.

mgradm/cmd/migrate/podman/utils.go Show resolved Hide resolved
@rjmateus
Copy link
Member

I if we set the prepare command we should stop just after the rsync of each volume. All the config changes (and probably the distribution copy) should be done only on final migrate.
The goal is to start copy the major data folder to speed migration.

@nadvornik
Copy link
Contributor Author

I think it is safe to let the migration scrip run till the end. All the config changes it does will be overwritten by the final run, but it can help to spot potential problems earlier, before stopping the old server.

@nadvornik
Copy link
Contributor Author

I have added kubernetes fixes - scale to 0 and skip traefik installation.

@nadvornik nadvornik requested a review from cbosdo June 25, 2024 13:48
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.

None yet

3 participants