Revision 8e8cf324 lib/backend.py

b/lib/backend.py
1508 1508
  if iname not in hyper.ListInstances(instance.hvparams):
1509 1509
    _Fail("Instance %s is not running", iname)
1510 1510

  
1511
  for idx in range(len(instance.disks)):
1511
  for idx in range(len(instance.disks_info)):
1512 1512
    link_name = _GetBlockDevSymlinkPath(iname, idx)
1513 1513
    if not os.path.islink(link_name):
1514 1514
      logging.warning("Instance %s is missing symlink %s for disk %d",
......
1794 1794

  
1795 1795
  """
1796 1796
  block_devices = []
1797
  for idx, disk in enumerate(instance.disks):
1797
  for idx, disk in enumerate(instance.disks_info):
1798 1798
    device = _RecursiveFindBD(disk)
1799 1799
    if device is None:
1800 1800
      raise errors.BlockDeviceError("Block device '%s' is not set up." %
......
1842 1842
  except errors.BlockDeviceError, err:
1843 1843
    _Fail("Block device error: %s", err, exc=True)
1844 1844
  except errors.HypervisorError, err:
1845
    _RemoveBlockDevLinks(instance.name, instance.disks)
1845
    _RemoveBlockDevLinks(instance.name, instance.disks_info)
1846 1846
    _Fail("Hypervisor error: %s", err, exc=True)
1847 1847

  
1848 1848

  
......
1918 1918
  except errors.HypervisorError, err:
1919 1919
    logging.warning("Failed to execute post-shutdown cleanup step: %s", err)
1920 1920

  
1921
  _RemoveBlockDevLinks(iname, instance.disks)
1921
  _RemoveBlockDevLinks(iname, instance.disks_info)
1922 1922

  
1923 1923

  
1924 1924
def InstanceReboot(instance, reboot_type, shutdown_timeout, reason):
......
2029 2029
    hyper.AcceptInstance(instance, info, target)
2030 2030
  except errors.HypervisorError, err:
2031 2031
    if instance.disk_template in constants.DTS_EXT_MIRROR:
2032
      _RemoveBlockDevLinks(instance.name, instance.disks)
2032
      _RemoveBlockDevLinks(instance.name, instance.disks_info)
2033 2033
    _Fail("Failed to accept instance: %s", err, exc=True)
2034 2034

  
2035 2035

  
......
3019 3019
    result["INSTANCE_%s" % attr.upper()] = str(getattr(instance, attr))
3020 3020

  
3021 3021
  result["HYPERVISOR"] = instance.hypervisor
3022
  result["DISK_COUNT"] = "%d" % len(instance.disks)
3022
  result["DISK_COUNT"] = "%d" % len(instance.disks_info)
3023 3023
  result["NIC_COUNT"] = "%d" % len(instance.nics)
3024 3024
  result["INSTANCE_SECONDARY_NODES"] = \
3025 3025
      ("%s" % " ".join(instance.secondary_nodes))
3026 3026

  
3027 3027
  # Disks
3028
  for idx, disk in enumerate(instance.disks):
3028
  for idx, disk in enumerate(instance.disks_info):
3029 3029
    real_disk = _OpenRealBD(disk)
3030 3030
    result["DISK_%d_PATH" % idx] = real_disk.dev_path
3031 3031
    result["DISK_%d_ACCESS" % idx] = disk.mode

Also available in: Unified diff