Logo Search packages:      
Sourcecode: ganeti version File versions  Download package

def lib::bdev::LogicalVolume::GetSyncStatus (   self  ) 

Returns the sync status of the device.

If this device is a mirroring device, this function returns the
status of the mirror.

Returns:
 (sync_percent, estimated_time, is_degraded, ldisk)

For logical volumes, sync_percent and estimated_time are always
None (no recovery in progress, as we don't handle the mirrored LV
case). The is_degraded parameter is the inverse of the ldisk
parameter.

For the ldisk parameter, we check if the logical volume has the
'virtual' type, which means it's not backed by existing storage
anymore (read from it return I/O error). This happens after a
physical disk failure and subsequent 'vgreduce --removemissing' on
the volume group.

Reimplemented from lib::bdev::BlockDev.

Definition at line 461 of file bdev.py.

00461                          :
    """Returns the sync status of the device.

    If this device is a mirroring device, this function returns the
    status of the mirror.

    Returns:
     (sync_percent, estimated_time, is_degraded, ldisk)

    For logical volumes, sync_percent and estimated_time are always
    None (no recovery in progress, as we don't handle the mirrored LV
    case). The is_degraded parameter is the inverse of the ldisk
    parameter.

    For the ldisk parameter, we check if the logical volume has the
    'virtual' type, which means it's not backed by existing storage
    anymore (read from it return I/O error). This happens after a
    physical disk failure and subsequent 'vgreduce --removemissing' on
    the volume group.

    """
    result = utils.RunCmd(["lvs", "--noheadings", "-olv_attr", self.dev_path])
    if result.failed:
      logger.Error("Can't display lv: %s" % result.fail_reason)
      return None, None, True, True
    out = result.stdout.strip()
    # format: type/permissions/alloc/fixed_minor/state/open
    if len(out) != 6:
      logger.Debug("Error in lvs output: attrs=%s, len != 6" % out)
      return None, None, True, True
    ldisk = out[0] == 'v' # virtual volume, i.e. doesn't have
                          # backing storage
    return None, None, ldisk, ldisk

  def Open(self, force=False):


Generated by  Doxygen 1.6.0   Back to index