ec2launcher 1.5.2 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 1.6.0
2
+
3
+ * Added option to set block device read-ahead value.
4
+
1
5
  ## 1.5.2
2
6
 
3
7
  * Use local copies of runurl, setup.rb and setup_instance.rb instead of pulling them down from GitHub every time.
@@ -18,6 +18,7 @@ module EC2Launcher
18
18
  dsl_accessor :raid_level
19
19
  dsl_accessor :size
20
20
  dsl_accessor :iops
21
+ dsl_accessor :block_ra
21
22
 
22
23
  def initialize(option_hash = nil)
23
24
  if option_hash
@@ -29,6 +30,7 @@ module EC2Launcher
29
30
  @mount = option_hash["mount_point"]
30
31
  @owner = option_hash["owner"]
31
32
  @group = option_hash["group"]
33
+ @block_ra = option_hash["block_ra"]
32
34
  end
33
35
 
34
36
  # Default values
@@ -56,7 +58,8 @@ module EC2Launcher
56
58
  "raid_level" => @raid_level,
57
59
  "mount_point" => @mount,
58
60
  "owner" => @owner,
59
- "group" => @group
61
+ "group" => @group,
62
+ "block_ra" => @block_ra
60
63
  }
61
64
  }
62
65
  end
@@ -2,5 +2,5 @@
2
2
  # Copyright (c) 2012 Sean Laurent
3
3
  #
4
4
  module EC2Launcher
5
- VERSION = "1.5.2"
5
+ VERSION = "1.6.0"
6
6
  end
@@ -375,6 +375,11 @@ EOF
375
375
  partition_devices([ "/dev/#{next_device_name}" ])
376
376
  format_filesystem(@system_arch, "/dev/#{next_device_name}1")
377
377
  end
378
+
379
+ if block_device.respond_to?(:block_ra) && block_device.block_ra
380
+ set_block_read_ahead("/dev/#{next_device_name}1", block_device.block_ra)
381
+ end
382
+
378
383
  mount_device("/dev/#{next_device_name}1", block_device.mount, block_device.owner, block_device.group, @default_fs_type)
379
384
  next_device_name.next!
380
385
  else
@@ -385,12 +390,25 @@ EOF
385
390
  end
386
391
  puts "Setting up attached raid array... system_arch = #{@system_arch}, raid_devices = #{raid_devices}, device = /dev/md#{(127 - raid_array_count).to_s}"
387
392
  raid_device_name = setup_attached_raid_array(@system_arch, raid_devices, "/dev/md#{(127 - raid_array_count).to_s}", block_device.raid_level.to_i, ! @options.clone_host.nil?)
393
+
394
+ if block_device.respond_to?(:block_ra) && block_device.block_ra
395
+ raid_devices.each {|device_name| set_block_read_ahead("#{device_name}1", block_device.read_ahead) }
396
+ set_block_read_ahead(raid_device_name, block_device.block_ra)
397
+ end
398
+
388
399
  mount_device(raid_device_name, block_device.mount, block_device.owner, block_device.group, @default_fs_type)
389
400
  raid_array_count += 1
390
401
  end
391
402
  end
392
403
  end
393
404
 
405
+ def set_block_read_ahead(device_name, read_ahead = nil)
406
+ if read_ahead
407
+ puts "Setting block device read ahead to #{read_ahead} for #{device_name}"
408
+ puts `blockdev --setra #{read_ahead} #{device_name}`
409
+ end
410
+ end
411
+
394
412
  # Creates filesystem on a device
395
413
  # XFS on 64-bit
396
414
  # ext4 on 32-bit
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ec2launcher
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.2
4
+ version: 1.6.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-12 00:00:00.000000000 Z
12
+ date: 2012-12-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: aws-sdk