Module: Pipette::Lvm

Included in:
Pipette
Defined in:
lib/pipette/lvm.rb

Instance Method Summary collapse

Instance Method Details

#lv_create(name, vg, size) ⇒ Object



22
23
24
25
26
27
28
29
# File 'lib/pipette/lvm.rb', line 22

def lv_create(name, vg, size)
	run_command "lvcreate",
							"--size #{size}G",
							"--name #{name}",
							vg

    lv_dev(vg, name)
end

#lv_extend(device, size) ⇒ Object



31
32
33
34
35
# File 'lib/pipette/lvm.rb', line 31

def lv_extend(device, size)
  run_command "lvextend",
              "--size #{size}G",
              device
end

#lv_remove(device) ⇒ Object



37
38
39
# File 'lib/pipette/lvm.rb', line 37

def lv_remove(device)
	run_command "lvremove", "--force", device
end

#pv_create(device) ⇒ Object



5
6
7
# File 'lib/pipette/lvm.rb', line 5

def pv_create(device)
  run_command "pvcreate", device
end

#vg_create(name, *devices) ⇒ Object



9
10
11
12
13
14
# File 'lib/pipette/lvm.rb', line 9

def vg_create(name, *devices)
  run_command "vgcreate",
              "--physicalextentsize 16M",
              name,
              *devices
end

#vg_extend(name, *devices) ⇒ Object



16
17
18
19
20
# File 'lib/pipette/lvm.rb', line 16

def vg_extend(name, *devices)
  run_command "vgextend",
              name,
              *devices
end