lvm icon indicating copy to clipboard operation
lvm copied to clipboard

Timeout formatting volume

Open kurtharriger opened this issue 9 years ago • 4 comments

Is there any way to increase the timeout? Looks like mkfs.ext4 is taking more than 5 minutes to format a 1000Gb ebs volume.

Mixlib::ShellOut::CommandTimeout -------------------------------- Command timed out after 600s: Command exceeded allowed execution time, process terminated ---- Begin output of yes | mkfs -t ext4 /dev/mapper/graphite-data ---- STDOUT: Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) Stride=0 blocks, Stripe width=0 blocks 65536000 inodes, 262142976 blocks 13107148 blocks (5.00%) reserved for the super user First data block=0 Maximum filesystem blocks=4294967296 8000 block groups 32768 blocks per group, 32768 fragments per group 8192 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 102400000, 214990848

Writing inode tables: 6751/8000
STDERR: mke2fs 1.41.12 (17-May-2010)
---- End output of yes | mkfs -t ext4  /dev/mapper/graphite-data ----
Ran yes | mkfs -t ext4  /dev/mapper/graphite-data returned

Cookbook Trace:
---------------
/var/chef/cache/cookbooks/lvm/libraries/provider_lvm_logical_volume.rb:99:in `action_create'

Resource Declaration:
---------------------
# In /var/chef/cache/cookbooks/rse_graphite/recipes/ebs.rb

 45:   lvm_logical_volume 'data' do
 46:     name  'data'
 47:     group 'graphite'
 48:     size        '100%VG'
 49:     filesystem  'ext4'
 50:     mount_point(location: mount_point, options: 'noatime,nodiratime')
 51:   end
 52:

kurtharriger avatar Jul 01 '15 19:07 kurtharriger

    # If file system is specified, format the logical volume
    if fs_type.nil?
      Chef::Log.info 'File system type is not set. Not formatting...'
    elsif device_formatted?(device_name, fs_type)
      Chef::Log.info "Volume '#{device_name}' is already formatted. Not formatting..."
    else
      shell_out!("yes | mkfs -t #{fs_type} #{fs_params} #{device_name}")
      updates << true
    end

Hi kurtharriger

Mixlib::Shellout accepts a time out argument so there is a way. Depending on what you need, a temporary solution, a permanent solution, widespread fix or not you might try one of these.

  • Add a timeout option to the lvm resource and provider.
  • See https://github.com/chef/mixlib-shellout/blob/master/lib/mixlib/shellout.rb and monkey patch the timeout value.

I didn't see anything built in to the current lvm code designed to do what you want.

Regards, Mark

MarkGibbons avatar Jul 02 '15 13:07 MarkGibbons

The workaround I came up with was to explicitly format the volume with an execute statement. lvm_logical_volume will detect that it has already been formatted and just configure fstab and mount point.

execute 'format' do command 'yes | mkfs -t ext4 /dev/mapper/graphite-data' not_if 'blkid -o value -s TYPE /dev/mapper/graphite-data' timeout 1200 end

kurtharriger avatar Jul 02 '15 14:07 kurtharriger

scratch that executing format explicitly only worked since the device already existed from failed run. Running on new machine failed since device had not yet been created.

kurtharriger avatar Jul 02 '15 16:07 kurtharriger

I'd like to request a :timeout parameter added to certain things. In particular, the default timeout was not enough to allow mkfs.ext4 on a 15TB lv.

Gary-Armstrong avatar May 06 '16 12:05 Gary-Armstrong