Skip to content
This repository has been archived by the owner on Jan 18, 2023. It is now read-only.

Defaults fail on mdadm v3.2.5? #2

Open
danwashusen opened this issue Nov 25, 2014 · 2 comments
Open

Defaults fail on mdadm v3.2.5? #2

danwashusen opened this issue Nov 25, 2014 · 2 comments

Comments

@danwashusen
Copy link

I'm new to chef so I might be missing something but when I run with defaults (pretty much what I'm after) I get the following error:

Recipe: ephemeral_raid::install
  * log[Ephemeral devices have been found] action write

  * package[mdadm] action install
    - install version 3.2.5-5ubuntu4.1 of package mdadm
Recipe: ephemeral_raid::cleanup
  * mount[/mnt/ephemeral] action umount (up to date)
  * mount[/mnt/ephemeral] action disable (up to date)
  * mount[/mnt] action umount
    - unmount /dev/xvdb
  * mount[/mnt] action disable
    - disable /dev/xvdb
  * ruby_block[unmount_and_zero_superblocks_of_ephemeral_devices] action createumount: /dev/xvdb: not mounted
1+0 records in
1+0 records out
5242880 bytes (5.2 MB) copied, 0.0688167 s, 76.2 MB/s
mdadm: Unrecognised md component device - /dev/xvdb
umount: /dev/xvdc: not mounted
1+0 records in
1+0 records out
5242880 bytes (5.2 MB) copied, 0.0468689 s, 112 MB/s
mdadm: Unrecognised md component device - /dev/xvdc

    - execute the ruby block unmount_and_zero_superblocks_of_ephemeral_devices
Recipe: ephemeral_raid::makeraid
  * mdadm[/dev/md0] action create

    ================================================================================
    Error executing action `create` on resource 'mdadm[/dev/md0]'
    ================================================================================

    Mixlib::ShellOut::ShellCommandFailed
    ------------------------------------
    Expected process to exit with [0], but received '1'
    ---- Begin output of yes | mdadm --create /dev/md0 --level 0 --chunk=256 --metadata=0.90 --bitmap=internal --raid-devices 2 /dev/xvdb /dev/xvdc ----
    STDOUT: 
    STDERR: mdadm: bitmaps not meaningful with level raid0
    ---- End output of yes | mdadm --create /dev/md0 --level 0 --chunk=256 --metadata=0.90 --bitmap=internal --raid-devices 2 /dev/xvdb /dev/xvdc ----
    Ran yes | mdadm --create /dev/md0 --level 0 --chunk=256 --metadata=0.90 --bitmap=internal --raid-devices 2 /dev/xvdb /dev/xvdc returned 1

    Resource Declaration:
    ---------------------
    # In /var/chef/cache/cookbooks/ephemeral_raid/recipes/makeraid.rb

     46:   mdadm "#{node[:ephemeral][:raid][:device]}" do
     47:     devices ephemeral_devices
     48:     chunk node[:ephemeral][:raid][:chunk_size] if node[:ephemeral][:raid][:chunk_size]
     49:     level node[:ephemeral][:raid][:level]
     50:     bitmap node[:ephemeral][:raid][:bitmap]
     51:     #spares node[:ephemeral][:raid][:spares] # not currently supported by the provider. Wai Opscode Wai ?
     52:     action :create
     53:     notifies :run, "execute[set_readahead_on_device_after_creation]", :immediately
     54:     only_if "which mdadm"
     55:   end
     56: end

    Compiled Resource:
    ------------------
    # Declared in /var/chef/cache/cookbooks/ephemeral_raid/recipes/makeraid.rb:46:in `from_file'

    mdadm("/dev/md0") do
      action [:create]
      retries 0
      retry_delay 2
      guard_interpreter :default
      chunk 256
      devices ["/dev/xvdb", "/dev/xvdc"]
      level 0
      metadata "0.90"
      bitmap "internal"
      raid_device "/dev/md0"
      cookbook_name "ephemeral_raid"
      recipe_name "makeraid"
      only_if "which mdadm"
    end

I've also tried setting "bitmap": "none" which resulted in:

---- Begin output of yes | mdadm --create /dev/md0 --level 0 --chunk=256 --metadata=0.90 --bitmap=none --raid-devices 2 /dev/xvdb /dev/xvdc ----
STDOUT: 
STDERR: mdadm: '--bitmap none' only support for --grow
---- End output of yes | mdadm --create /dev/md0 --level 0 --chunk=256 --metadata=0.90 --bitmap=none --raid-devices 2 /dev/xvdb /dev/xvdc ----
Ran yes | mdadm --create /dev/md0 --level 0 --chunk=256 --metadata=0.90 --bitmap=none --raid-devices 2 /dev/xvdb /dev/xvdc returned 2

Editing recipes/makeraid.rb removing bitmap node[:ephemeral][:raid][:bitmap] seems to fix/workaround the issue.

@contrapunctus-xv
Copy link

@danwashusen, I had the same issue.

I ended up actually passing in

"ephemeral": { 
    "raid": { 
       "level": "0"
     } 
}

to overwrite because the default value for level is integer 0 and not string 0 (which is what it's being compared to in the conditional in makeraid.rb in line 34 .

EDIT

sorry didn't realize the dev version has different code. you should do what I said on this version https://github.com/atrull/ephemeral_raid_cookbook

@atrull
Copy link

atrull commented Jun 24, 2015

Is this still an issue, BTW ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants