Skip to content

Bug fix - automatic software raid install using answerfile#52

Open
jjuanar wants to merge 1 commit intoxcp-ng:10.10.29-8.3from
aquaray:auto-software-raid
Open

Bug fix - automatic software raid install using answerfile#52
jjuanar wants to merge 1 commit intoxcp-ng:10.10.29-8.3from
aquaray:auto-software-raid

Conversation

@jjuanar
Copy link
Copy Markdown

@jjuanar jjuanar commented Oct 21, 2025

The bug in question happens when the code tries to check the logical_block_size of the md device that wasn't created yet.
To reproduce the bug install xcp-ng via pxe and answerfile while using the raid drive as a primary drive and not turning off sr storage on said drive.

Updated the way disks are parsed when selecting SR_TYPE, more specifically when checking disk block size to take into consideration software raid disks that hasn't been created yet.

This patch sends the results of parseRaid() into parseDisk() so that the md devices can be ignored in the initial check and have the device's children checked for block size instead, while still reporting the md device's future block size (since the code checks if the block size is over 512, if any children is over 512 then the md device when created later on must be over 512)

Example answerfile:

<?xml version="1.0"?>
    <installation mode="fresh" srtype="ext">
        <raid device="md127">
                <disk>vda</disk>
                <disk>vdb</disk>
        </raid>
        <primary-disk>md127</primary-disk>
        <keymap>us</keymap>
        <root-password>yesroot</root-password>
        <source type="url">http://192.168.120.2/xcp-ng/install/</source>
        <admin-interface name="eth0" proto="dhcp" />
        <timezone>Europe/Paris</timezone>
    </installation>

…cally when checking disk block size to take into consideration software raid disks that hasn't been created yet.

This patch sends the results of parseRaid into parseDisk so that the md devices can be ignored in the initial check and have the device children checked for block size instead, while still reporting the md device's future block size (since the code checks if the block size is over 512 if any children is over 512 then the md device when created later on must be over 512)

Signed-off-by: jjuanar <jjuan@aquaray.com>
Copy link
Copy Markdown

@rzr rzr left a comment

Choose a reason for hiding this comment

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

lgtm

rzr
rzr previously approved these changes Dec 17, 2025
@rzr rzr requested a review from a team December 17, 2025 13:24
Copy link
Copy Markdown
Member

@glehmann glehmann left a comment

Choose a reason for hiding this comment

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

a review comment

glehmann
glehmann previously approved these changes Dec 17, 2025
@glehmann glehmann dismissed stale reviews from rzr and themself December 17, 2025 13:27

just an experiment

@rzr rzr requested review from rzr and removed request for rzr December 17, 2025 13:29
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.

3 participants