Skip to content

Ubuntu OSMorphing Refactor#427

Open
Dany9966 wants to merge 3 commits into
cloudbase:masterfrom
Dany9966:ubuntu-refactor
Open

Ubuntu OSMorphing Refactor#427
Dany9966 wants to merge 3 commits into
cloudbase:masterfrom
Dany9966:ubuntu-refactor

Conversation

@Dany9966
Copy link
Copy Markdown
Contributor

@Dany9966 Dany9966 commented May 11, 2026

This PR contains the following patches:

  1. Fix new cloud-init version service enablement.

    New cloud-init version (>26) changed its systemd unit service name,
    therefore the enablement method needs to reflect that.

  2. Improve upon Ubuntu OSMorphing tool check

    This patch drops OSMorphing support for any non-LTS Ubuntu release.
    This will allow for provider-side refactoring and tool grouping.

  3. Replace all deprecated @abc.abstractclassmethod declarations

    Replaced them with stacked @classmethod\n@abc.abstractmethod

Comment thread coriolis/osmorphing/ubuntu.py Outdated
minimum=lts_release, maximum=lts_release):
return True
_, subversion = detected_os_info['release_version'].split('.', 1)
if not subversion.startswith("04"):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not all *.04 releases are LTS, for example 25.04 is not a LTS release. You may want to check if the major version is an even number.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Very good catch, thank you!

LOG.warning(
"Detected Ubuntu release version "
f"'{detected_os_info['release_version']}' is not an LTS one. "
"Coriolis only supports morphing Ubuntu LTS versions.")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So we're completely dropping support for non-LTS Ubuntu releases (at the moment it accepts non-LTS versions newer than 22.04).

That's reasonable, however let's clearly state it in the PR message.

This patch makes sure that the base Ubuntu osmorphing tool checks
for the migrated machine's subversion, and makes sure that it's an
LTS subversion, instead of checking each LTS version separately.

As it's stated now, it implies that we're rewriting the version check, not that we're completely dropping support for non-LTS releases. Simply saying This patch drops os-morphing support for non-LTS Ubuntu releases. would be much clearer.

Copy link
Copy Markdown
Contributor Author

@Dany9966 Dany9966 May 13, 2026

Choose a reason for hiding this comment

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

We never officially supported non-LTS versions, see the old code, it literally just went through the list of LTS versions (at the time), and otherwise it refused to use any kind of other ubuntu release (if you consider the provider code as well).

Anyway, I'll clarify the PR and commit messages. Thank you!

Copy link
Copy Markdown
Member

@petrutlucian94 petrutlucian94 May 13, 2026

Choose a reason for hiding this comment

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

Interesting. The current code checks if it's a LTS version. If it isn't, then it checks if it's newer than 22.04. Unless I'm mistaken, 22.10 would be reported as "supported.

This made me believe that we had the policy of supporting recent non-LTS releases.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

At least at the base level maybe it was an attempt at future-proofing, but the providers had specific supported versions, and they all had tools for LTS versions only.
We're trying to future-proof both the core and provider tools with these additions.

New cloud-init version (>26) changed its systemd unit service name,
therefore the enablement method needs to reflect that.
Dany9966 added 2 commits May 13, 2026 16:37
This patch drops OSMorphing support for any non-LTS Ubuntu release.
This will allow for provider-side refactoring and tool grouping.
Replaced them with stacked `@classmethod\n@abc.abstractmethod`
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