Alow specifying the os-morphing user script phase#99
Merged
Conversation
When deploying replicas, Coriolis users can specify scripts that will be executed
during os-morphing, right after the OS partition is mounted on the minion instance.
In some situations, this is too late since user scripts may be needed in order
to be able to mount the OS disk, for example if it’s encrypted.
In other situations it’s too early. Some scripts may need to be executed on
the replica instance. This may require provider assistance.
To accommodate these use cases, we’ve extended the deployment API, allowing the
user to specify when a given script should be executed. Each script may specify
one of the following execution phases:
* osmorphing-pre-os-mount
* osmorphing-post-os-mount (default)
* replica-initial-boot (TBD)
Samples:
* Explicit phase
--user-script-global linux=/some/script.sh,phase=osmorphing-pre-os-mount
* Implicit phase, defaults to osmorphing-post-os-mount
--user-script-global linux=/some/script.sh
* Repeating the flag, specifying multiple scripts:
--user-script-instance some-instance=/some/script.sh,phase=osmorphing-pre-os-mount
--user-script-instance some-instance=/other/script.sh,phase=osmorphing-pre-os-mount
--user-script-instance some-instance=/another/script.sh,phase=osmorphing-post-os-mount
c1acb74 to
f51a123
Compare
claudiubelu
reviewed
May 26, 2026
Dany9966
reviewed
May 26, 2026
We'll pass type=comma_separated_kv_to_dict when defining user script args, letting it do the parsing for us.
Older flake8/pycodestyle versions weren't able to properly handle f strings, so we had to add "noqa" comments. This issue was addressed in recent versions, all we have to do is bump the "hacking" dependency, which currently enforces older flake8 releases. PyCQA/pycodestyle#1148
6312c3b to
1819853
Compare
* specify the supported phases and which one is the default * mention the fact that when updating transfers, the script path can be omitted in order to unregister it
1819853 to
82cf920
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When deploying replicas, Coriolis users can specify scripts that will be executed during os-morphing, right after the OS partition is mounted on the minion instance.
In some situations, this is too late since user scripts may be needed in order to be able to mount the OS disk, for example if it’s encrypted.
In other situations it’s too early. Some scripts may need to be executed on the replica instance. This may require provider assistance.
To accommodate these use cases, we’ve extended the deployment API, allowing the user to specify when a given script should be executed. Each script may specify one of the following execution phases:
Samples: