def BlockdevOpen(instance_name, disks, exclusive):
  bdevs = []
  for cf in disks:
    rd = _RecursiveFindBD(cf)
    if rd is None:
      _Fail("Can't find device %s", cf)
    bdevs.append(rd)

  msg = []
  for idx, rd in enumerate(bdevs):
    try:
      rd.Open(exclusive=exclusive)
      _SymlinkBlockDev(instance_name, rd.dev_path, uuid=disks[idx].uuid)
      # Also create an old type of symlink so that instances
      # can be migratable, since they may still have deprecated
      # symlinks in their runtime files.
      _SymlinkBlockDev(instance_name, rd.dev_path, idx=idx)
    except errors.BlockDeviceError, err:
      msg.append(str(err))

  if msg:
    _Fail("Can't open devices: %s", ",".join(msg))
Opens the given block devices.
dataset/ETHPy150Open ganeti/ganeti/lib/backend.py/BlockdevOpen