Revision 2209788e lib/cmdlib/instance.py

b/lib/cmdlib/instance.py
1766 1766
                        idx, result.fail_msg)
1767 1767
        errs.append(result.fail_msg)
1768 1768
        break
1769
      dev_path = result.payload
1769
      dev_path, _ = result.payload
1770 1770
      result = self.rpc.call_blockdev_export(source_node, (disk, instance),
1771 1771
                                             target_node, dev_path,
1772 1772
                                             cluster_name)
......
3108 3108
    self.LogInfo("Trying to hotplug device...")
3109 3109
    result = self.rpc.call_hotplug_device(self.instance.primary_node,
3110 3110
                                          self.instance, action, dev_type,
3111
                                          device, extra, seq)
3111
                                          (device, self.instance),
3112
                                          extra, seq)
3112 3113
    if result.fail_msg:
3113 3114
      self.LogWarning("Could not hotplug device: %s" % result.fail_msg)
3114 3115
      self.LogInfo("Continuing execution..")
......
3143 3144
                         cleanup=new_disks)
3144 3145

  
3145 3146
    if self.op.hotplug:
3146
      _, device_info = AssembleInstanceDisks(self, self.instance,
3147
                                             [disk], check=False)
3148
      _, _, dev_path = device_info[0]
3149
      self._HotplugDevice(constants.HOTPLUG_ACTION_ADD,
3150
                          constants.HOTPLUG_TARGET_DISK,
3151
                          disk, dev_path, idx)
3147
      # _, device_info = AssembleInstanceDisks(self, self.instance,
3148
      #                                       [disk], check=False)
3149
      self.cfg.SetDiskID(disk, self.instance.primary_node)
3150
      result = self.rpc.call_blockdev_assemble(self.instance.primary_node,
3151
                                               (disk, self.instance),
3152
                                               self.instance.name, True, idx)
3153
      if result.fail_msg:
3154
        self.LogWarning("Can't assemble newly created disk %d: %s",
3155
                        idx, result.fail_msg)
3156
      else:
3157
        # _, _, dev_path = device_info[0]
3158
        _, link_name = result.payload
3159
        self._HotplugDevice(constants.HOTPLUG_ACTION_ADD,
3160
                            constants.HOTPLUG_TARGET_DISK,
3161
                            disk, link_name, idx)
3152 3162

  
3153 3163
    return (disk, [
3154 3164
      ("disk/%d" % idx, "add:size=%s,mode=%s" % (disk.size, disk.mode)),

Also available in: Unified diff