Revision 87812fd3

b/lib/backend.py
1743 1743
    r_dev = _RecursiveFindBD(disk)
1744 1744
    if r_dev is not None:
1745 1745
      # let's stay on the safe side and ask for the full size, for now
1746
      return r_dev.Snapshot(disk.size)
1746
      return True, r_dev.Snapshot(disk.size)
1747 1747
    else:
1748
      return None
1748
      _Fail("Cannot find block device %s", disk)
1749 1749
  else:
1750
    raise errors.ProgrammerError("Cannot snapshot non-lvm block device"
1751
                                 " '%s' of type '%s'" %
1752
                                 (disk.unique_id, disk.dev_type))
1750
    _Fail("Cannot snapshot non-lvm block device '%s' of type '%s'",
1751
          disk.unique_id, disk.dev_type)
1753 1752

  
1754 1753

  
1755 1754
def ExportSnapshot(disk, dest_node, instance, cluster_name, idx):
b/lib/cmdlib.py
6462 6462

  
6463 6463
    try:
6464 6464
      for disk in instance.disks:
6465
        # new_dev_name will be a snapshot of an lvm leaf of the one we passed
6466
        new_dev_name = self.rpc.call_blockdev_snapshot(src_node, disk)
6467
        if new_dev_name.failed or not new_dev_name.data:
6468
          self.LogWarning("Could not snapshot block device %s on node %s",
6469
                          disk.logical_id[1], src_node)
6465
        # result.payload will be a snapshot of an lvm leaf of the one we passed
6466
        result = self.rpc.call_blockdev_snapshot(src_node, disk)
6467
        msg = result.RemoteFailMsg()
6468
        if msg:
6469
          self.LogWarning("Could not snapshot block device %s on node %s: %s",
6470
                          disk.logical_id[1], src_node, msg)
6470 6471
          snap_disks.append(False)
6471 6472
        else:
6473
          disk_id = (vgname, result.payload)
6472 6474
          new_dev = objects.Disk(dev_type=constants.LD_LV, size=disk.size,
6473
                                 logical_id=(vgname, new_dev_name.data),
6474
                                 physical_id=(vgname, new_dev_name.data),
6475
                                 logical_id=disk_id, physical_id=disk_id,
6475 6476
                                 iv_name=disk.iv_name)
6476 6477
          snap_disks.append(new_dev)
6477 6478

  

Also available in: Unified diff