1879 |
|
|
1880 |
# TODO: validate peSize if given |
# TODO: validate peSize if given |
1881 |
if not self.peSize: |
if not self.peSize: |
1882 |
self.peSize = 4.0 # MB |
self.peSize = 32.0 # MB |
1883 |
|
|
1884 |
if not self.exists: |
if not self.exists: |
1885 |
self.pvCount = len(self.parents) |
self.pvCount = len(self.parents) |
2249 |
used = sum(lv.vgSpaceUsed for lv in self.lvs) + self.snapshotSpace |
used = sum(lv.vgSpaceUsed for lv in self.lvs) + self.snapshotSpace |
2250 |
used += self.reservedSpace |
used += self.reservedSpace |
2251 |
free = self.size - used |
free = self.size - used |
2252 |
|
|
2253 |
|
pad = self.peSize * 2 * len(self.pvs) |
2254 |
|
if free >= pad: |
2255 |
|
free -= pad |
2256 |
|
|
2257 |
log.debug("vg %s has %dMB free" % (self.name, free)) |
log.debug("vg %s has %dMB free" % (self.name, free)) |
2258 |
return free |
return free |
2259 |
|
|
3144 |
|
|
3145 |
disks = [disk.path for disk in self.devices] |
disks = [disk.path for disk in self.devices] |
3146 |
spares = len(self.devices) - self.memberDevices |
spares = len(self.devices) - self.memberDevices |
3147 |
|
|
3148 |
|
# allow creation of degraded arrays |
3149 |
|
if len(disks) == 1: |
3150 |
|
disks.append("missing") |
3151 |
|
|
3152 |
mdraid.mdcreate(self.path, |
mdraid.mdcreate(self.path, |
3153 |
self.level, |
self.level, |
3154 |
disks, |
disks, |