-
Notifications
You must be signed in to change notification settings - Fork 4
check the xapi version in the installer #48
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
base: 10.10.29-8.3
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,7 @@ | |
| import re | ||
| import tempfile | ||
|
|
||
| import rpm | ||
| import repository | ||
| import generalui | ||
| import xelogging | ||
|
|
@@ -161,7 +162,7 @@ def getPrepSequence(ans, interactive): | |
|
|
||
| def getMainRepoSequence(ans, repos): | ||
| seq = [] | ||
| seq.append(Task(repository.installFromRepos, lambda a: [repos] + [a.get('mounts'), a.get('kernel-alt'), a.get('linstor-version')], [], | ||
| seq.append(Task(repository.installFromRepos, lambda a: [repos] + [a.get('mounts'), a.get('kernel-alt'), a.get('linstor-version'), a.get('xapi-version')], [], | ||
| progress_scale=100, | ||
| pass_progress_callback=True, | ||
| progress_text="Installing %s..." % (", ".join([repo.name() for repo in repos])))) | ||
|
|
@@ -440,6 +441,19 @@ def performInstallation(answers, ui_package, interactive): | |
| "latest dedicated ISO." % | ||
| (answers['linstor-version'], ', '.join(available_linstor_versions))) | ||
|
|
||
| # if upgrading a host with xapi, check we can upgrade it first | ||
| if answers['install-type'] == INSTALL_TYPE_REINSTALL and answers['xapi-version']: | ||
| available_xapi_versions = repository.listPackagesFromRepos( | ||
| main_repositories, 'xapi-core', '%{evr}', latest_only=True) | ||
| if not available_xapi_versions: | ||
| raise RuntimeError("No XAPI package found in package source") | ||
| assert len(available_xapi_versions) == 1 | ||
| if rpm.labelCompare(('pkg', 'arch', available_xapi_versions[0]), ('pkg', 'arch', answers['xapi-version'])) < 0: | ||
| raise RuntimeError("Cannot upgrade the host: the XAPI version on the host (%s) " | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Didn't we just say that it may be better to make it a warning screen rather than a fatal error? |
||
| "is newer than the XAPI version to install (%s). " | ||
| "Please refer to the XCP-ng upgrade documentation." % | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's not forget to add said doc. We can discuss what we should tell users. I know it's already covered at least for migration from XS, but I'm thinking about users who'd go check the docs after they saw the error. Something that explicitly gives them the error message their search for and explains their options. |
||
| (answers['xapi-version'], available_xapi_versions[0])) | ||
|
|
||
| # perform installation: | ||
| prep_seq = getPrepSequence(answers, interactive) | ||
| executeSequence(prep_seq, "Preparing for installation...", answers, ui_package, False) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -608,7 +608,7 @@ def replace_config(config_file, destination): | |
| primary_fs.unmount() | ||
|
|
||
| prepUpgradeArgs = [] | ||
| prepStateChanges = ['installation-uuid', 'control-domain-uuid', 'management-address-type', 'linstor-version'] | ||
| prepStateChanges = ['installation-uuid', 'control-domain-uuid', 'management-address-type', 'linstor-version', 'xapi-version'] | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would rather add
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good point, but as we need both on the same line, and for now this PR is based on the version with all the branches merged. I'll take care of that later when I'll make this PR based on upstream only :-) |
||
| def prepareUpgrade(self, progress_callback): | ||
| """ Try to preserve the installation and control-domain UUIDs from | ||
| xensource-inventory.""" | ||
|
|
@@ -619,7 +619,7 @@ def prepareUpgrade(self, progress_callback): | |
| except KeyError: | ||
| raise RuntimeError("Required information (INSTALLATION_UUID, CONTROL_DOMAIN_UUID, MANAGEMENT_ADDRESS_TYPE) was missing from your xensource-inventory file. Aborting installation; please replace these keys and try again.") | ||
|
|
||
| return installID, controlID, mgmtAddrType, self.source.settings['linstor-version'] | ||
| return installID, controlID, mgmtAddrType, self.source.settings['linstor-version'], self.source.settings['xapi-version'] | ||
|
|
||
| def buildRestoreList(self, src_base): | ||
| restore_list = [] | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.