mdraid name creates broken configuration

Bug #1803933 reported by Luca Cervigni
22
This bug affects 2 people
Affects Status Importance Assigned to Milestone
MAAS
Invalid
Undecided
Unassigned
curtin
Fix Committed
Undecided
James Falcon

Bug Description

creating a raid1 on a two PARTITIONS works, both via the web interface and CLI.

Once the system is deploying though the wrong path is initialized, trying on chroot /dev/name-of-raid instead of /dev/md/name-of-raid.

adding a prefix to the existent raid given name though makes it work. for example calling the raid md/my-raid works and the systems deploys successfully.

Creating further partitions on top of the mdadm block devices does not change the situation.

Screenshot attached.

Logs:

curtin: Installation started. (18.1-17-gae48e86f-0ubuntu1~18.04.1)
third party drivers not installed or necessary.
An error occured handling 'os-raid1': ProcessExecutionError - Unexpected error while running command.
Command: ['mdadm', '--create', '/dev/os-raid1', '--run', '--homehost=ceph-r3-h14', '--level=1', '--raid-devices=2', '/dev/sda2', '/dev/sdb2']
Exit code: 1
Reason: -
Stdout: ''
Stderr: mdadm: Note: this array has metadata at the start and
            may not be suitable as a boot device. If you plan to
            store '/boot' on this device please ensure that
            your boot-loader understands md/v1.x metadata, or use
            --metadata=0.90
        mdadm: /dev/os-raid1 is an invalid name for an md device. Try /dev/md/os-raid1

Unexpected error while running command.
Command: ['mdadm', '--create', '/dev/os-raid1', '--run', '--homehost=ceph-r3-h14', '--level=1', '--raid-devices=2', '/dev/sda2', '/dev/sdb2']
Exit code: 1
Reason: -
Stdout: ''
Stderr: mdadm: Note: this array has metadata at the start and
            may not be suitable as a boot device. If you plan to
            store '/boot' on this device please ensure that
            your boot-loader understands md/v1.x metadata, or use
            --metadata=0.90
        mdadm: /dev/os-raid1 is an invalid name for an md device. Try /dev/md/os-raid1

curtin: Installation failed with exception: Unexpected error while running command.
Command: ['curtin', 'block-meta', 'custom']
Exit code: 3
Reason: -
Stdout: An error occured handling 'os-raid1': ProcessExecutionError - Unexpected error while running command.
        Command: ['mdadm', '--create', '/dev/os-raid1', '--run', '--homehost=ceph-r3-h14', '--level=1', '--raid-devices=2', '/dev/sda2', '/dev/sdb2']
        Exit code: 1
        Reason: -
        Stdout: ''
        Stderr: mdadm: Note: this array has metadata at the start and
                    may not be suitable as a boot device. If you plan to
                    store '/boot' on this device please ensure that
                    your boot-loader understands md/v1.x metadata, or use
                    --metadata=0.90
                mdadm: /dev/os-raid1 is an invalid name for an md device. Try /dev/md/os-raid1

        Unexpected error while running command.
        Command: ['mdadm', '--create', '/dev/os-raid1', '--run', '--homehost=ceph-r3-h14', '--level=1', '--raid-devices=2', '/dev/sda2', '/dev/sdb2']
        Exit code: 1
        Reason: -
        Stdout: ''
        Stderr: mdadm: Note: this array has metadata at the start and
                    may not be suitable as a boot device. If you plan to
                    store '/boot' on this device please ensure that
                    your boot-loader understands md/v1.x metadata, or use
                    --metadata=0.90
                mdadm: /dev/os-raid1 is an invalid name for an md device. Try /dev/md/os-raid1

Stderr: ''

Related branches

Revision history for this message
Luca Cervigni (cervigni) wrote :
Revision history for this message
Blake Rouse (blake-rouse) wrote :

This is not a MAAS issue but a curtin issue (what MAAS uses for the installation).

Changed in maas:
status: New → Incomplete
status: Incomplete → Invalid
Revision history for this message
Andres Rodriguez (andreserl) wrote :

Hi there,

Could you please provide the curtin configuration sent to the machine?

maas <user> machine get-curtin-config <system-id>

Changed in curtin:
status: New → Incomplete
Revision history for this message
Ryan Harper (raharper) wrote :

Curtin can validate the name value in the config; if it matches kernel names (mdXX) then the path can be /dev/{name} if it doesn't match then it needs to use /dev/md/{name}.

Revision history for this message
Luca Cervigni (cervigni) wrote :
Download full text (7.6 KiB)

Ryan,
I can understand that, but if the case some form of variable check has to be put in place.

Here the logs requested by Andres:

ubuntu@maas:~$ maas admin machine get-curtin-config pctfwe
Success.
Machine-readable output follows:
apt:
  preserve_sources_list: false
  primary:
  - arches:
    - default
    uri: http://archive.ubuntu.com/ubuntu
  proxy: xxxxxxxx
  security:
  - arches:
    - default
    uri: http://archive.ubuntu.com/ubuntu
cloudconfig:
  maas-cloud-config:
    content: xxxxxxxxxx
    path: /etc/cloud/cloud.cfg.d/90_maas_cloud_config.cfg
  maas-datasource:
    content: 'datasource_list: [ MAAS ]'
    path: /etc/cloud/cloud.cfg.d/90_maas_datasource.cfg
  maas-reporting:
    content: xxxxxxxxx
    path: /etc/cloud/cloud.cfg.d/90_maas_cloud_init_reporting.cfg
  maas-ubuntu-sso:
    content: '#cloud-config

      snappy: {email: <email address hidden>}

      '
    path: /etc/cloud/cloud.cfg.d/90_maas_ubuntu_sso.cfg
debconf_selections:
  grub2: grub2 grub2/update_nvram boolean false
  maas: 'cloud-init cloud-init/datasources multiselect MAAS

    cloud-init cloud-init/maas-metadata-url string http://xxxxxxxxxx/MAAS/metadata/
xxxxxx

    cloud-init cloud-init/local-cloud-config string apt:\n preserve_sources_list:
    false\n primary:\n - arches: [default]\n uri: http://archive.ubuntu.com/ubuntu\n proxy:
    http://xxxxxxxx:8000/\n security:\n - arches: [default]\n uri: http://archive.ubuntu.com/ubuntu\napt_preserve_sources_list:
    true\napt_proxy: http://146.118.53.253:8000/\nmanage_etc_hosts: false\nmanual_cache_clean:
    true\nreporting:\n maas: {consumer_key: xxxxxxxxx, endpoint: ''http://xxxxxxx5240/MAAS/metadata/status/pctfwe'',\n token_key:
    xxxxxxxx, token_secret: xxxxxxx,\n type:
    webhook}\nsystem_info:\n package_mirrors:\n - arches: [i386, amd64]\n failsafe:
    {primary: ''http://archive.ubuntu.com/ubuntu'', security: ''http://security.ubuntu.com/ubuntu''}\n search:\n primary:
    [''http://archive.ubuntu.com/ubuntu'']\n security: [''http://archive.ubuntu.com/ubuntu'']\n -
    arches: [default]\n failsafe: {primary: ''http://ports.ubuntu.com/ubuntu-ports'',
    security: ''http://ports.ubuntu.com/ubuntu-ports''}\n search:\n primary:
    [''http://ports.ubuntu.com/ubuntu-ports'']\n security: [''http://ports.ubuntu.com/ubuntu-ports'']\n

    '
early_commands:
  driver_00:
  - sh
  - -c
  - echo third party drivers not installed or necessary.
install:
  error_tarfile: /tmp/curtin-logs.tar
  log_file: /tmp/install.log
  post_files:
  - /tmp/install.log
  - /tmp/curtin-logs.tar
kernel:
  mapping: {}
  package: linux-signed-generic
late_commands:
  maas:
  - wget
  - --no-proxy
  - xxxxxx
  - --post-data
  - op=netboot_off
  - -O
  - /dev/null
  repos_conf:
  - curtin
  - in-target
  - --
  - sh
  - -c
  - git clone xxxxxxt
    /tmp/cloud-baremetal-provisioning
  zone_script:
  - curtin
  - in-target
  - --
  - sh
  - -c
  - /bin/bash xxxx
    -r xenial
network:
  config:
  - id: enp0s29u1u1u5
    mac_address: 42:f2:e9:75:6c:87
    mtu: 1500
    name: enp0s29u1u1u5
    subnets:
    - type: manual
    type: physical
  - id: enp10s0
    mac_addr...

Read more...

Revision history for this message
Ryan Harper (raharper) wrote : Re: [Bug 1803933] Re: mdraid name creates broken configuration

On Tue, Nov 20, 2018 at 1:30 AM Luca Cervigni
<email address hidden> wrote:
>
> Ryan,
> I can understand that, but if the case some form of variable check has to be put in place.

I was just confirming the behavior you're seeing and that it is a bug
that we need to fix.
It's fine for MAAS to allow you to name the raid array; the installer
code (curtin) will need to
handle the non mdX names and specify the path correctly.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for curtin because there has been no activity for 60 days.]

Changed in curtin:
status: Incomplete → Expired
Ryan Harper (raharper)
Changed in curtin:
status: Expired → Confirmed
James Falcon (falcojr)
Changed in curtin:
assignee: nobody → James Falcon (falcojr)
Dan Watkins (oddbloke)
Changed in curtin:
status: Confirmed → In Progress
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

This bug is fixed with commit a0ede163 to curtin on branch master.
To view that commit see the following URL:
https://git.launchpad.net/curtin/commit/?id=a0ede163

Changed in curtin:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.