Revision 59da826f lib/cmdlib.py

b/lib/cmdlib.py
63 63
import ganeti.masterd.instance # pylint: disable=W0611
64 64

  
65 65

  
66
#: Size of DRBD meta block device
67
DRBD_META_SIZE = 128
68

  
69

  
66 70
class ResultWithJobs:
67 71
  """Data container for LU results with jobs.
68 72

  
......
7829 7833
  shared_secret = lu.cfg.GenerateDRBDSecret(lu.proc.GetECId())
7830 7834
  dev_data = objects.Disk(dev_type=constants.LD_LV, size=size,
7831 7835
                          logical_id=(vgnames[0], names[0]))
7832
  dev_meta = objects.Disk(dev_type=constants.LD_LV, size=128,
7836
  dev_meta = objects.Disk(dev_type=constants.LD_LV, size=DRBD_META_SIZE,
7833 7837
                          logical_id=(vgnames[1], names[1]))
7834 7838
  drbd_dev = objects.Disk(dev_type=constants.LD_DRBD8, size=size,
7835 7839
                          logical_id=(primary, secondary, port,
......
8149 8153
    constants.DT_DISKLESS: {},
8150 8154
    constants.DT_PLAIN: _compute(disks, 0),
8151 8155
    # 128 MB are added for drbd metadata for each disk
8152
    constants.DT_DRBD8: _compute(disks, 128),
8156
    constants.DT_DRBD8: _compute(disks, DRBD_META_SIZE),
8153 8157
    constants.DT_FILE: {},
8154 8158
    constants.DT_SHARED_FILE: {},
8155 8159
  }
......
8170 8174
    constants.DT_DISKLESS: None,
8171 8175
    constants.DT_PLAIN: sum(d[constants.IDISK_SIZE] for d in disks),
8172 8176
    # 128 MB are added for drbd metadata for each disk
8173
    constants.DT_DRBD8: sum(d[constants.IDISK_SIZE] + 128 for d in disks),
8177
    constants.DT_DRBD8:
8178
      sum(d[constants.IDISK_SIZE] + DRBD_META_SIZE for d in disks),
8174 8179
    constants.DT_FILE: None,
8175 8180
    constants.DT_SHARED_FILE: 0,
8176 8181
    constants.DT_BLOCK: 0,
......
9835 9840
      lv_data = objects.Disk(dev_type=constants.LD_LV, size=dev.size,
9836 9841
                             logical_id=(vg_data, names[0]))
9837 9842
      vg_meta = dev.children[1].logical_id[0]
9838
      lv_meta = objects.Disk(dev_type=constants.LD_LV, size=128,
9843
      lv_meta = objects.Disk(dev_type=constants.LD_LV, size=DRBD_META_SIZE,
9839 9844
                             logical_id=(vg_meta, names[1]))
9840 9845

  
9841 9846
      new_lvs = [lv_data, lv_meta]

Also available in: Unified diff