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

Tolerance of pre-existing software-RAID #38

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
4 changes: 4 additions & 0 deletions constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,7 @@ def error_string(error, logname, with_hd):
'var/lib/misc/ran-network-init',
'var/lib/misc/ran-storage-init',
]

# optional features
FEATURES_DIR = "/etc/xensource/features"
HAS_RAID_ASSEMBLE = os.path.exists(os.path.join(FEATURES_DIR, "raid-assemble"))
18 changes: 18 additions & 0 deletions doc/features.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Features flags
==============

Some host-installer features are not enabled by default, and
downstream installers can activate them by creating a file in
/etc/xensource/features/ in their installer filesystem.

Currently available feature flags are:

raid-assemble

Detect Linux software-RAID (a.k.a "md") superblocks in disks, adds
a choice for the user to activate software RAID volumes, and do
not offer the user the ability to upgrade or restore a system on a
software-RAID device.

This only impacts the UI, the <assemble-raid/> answerfile
construct does not need this feature flag.
2 changes: 1 addition & 1 deletion tui/installer/screens.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def get_installation_type(answers):
# RAID members, for filtering out from upgradable-products and
# backups, and to decide whether to propose to activate existing RAID.
raid_members = []
if "assemble-raid" not in answers:
if constants.HAS_RAID_ASSEMBLE and "assemble-raid" not in answers:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The feature flag to enable from presenting the "assemble RAID" option also disables the safety measure of filtering out upgrade/restore entries that the user should not select, as they indeed live on a RAID volume. It is I think a bad idea to allow the user to do this, but then hiding those options without letting the user assemble RAID volumes looks like a bad idea too. I would rather just let the behavior added by this PR be the default, and just not add this feature flag.

Copy link
Contributor

Choose a reason for hiding this comment

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

As XenServer doesn't support installing on software RAID at all, it is better to keep the feature flag to hide the "assemble RAID" option. The button would be too confusing for users in a XenServer context.

for disk in diskutil.getQualifiedDiskList():
rv, out = util.runCmd2([ 'mdadm', '--examine', disk ], with_stdout=True)
if rv == 0 and re.search("Array UUID :", out):
Expand Down