Revision 31135ddd

b/lib/backend.py
1581 1581
  except Exception, err:  # pylint: disable=W0703
1582 1582
    _Fail("Failed to get migration status: %s", err, exc=True)
1583 1583

  
1584
def HotAddDisk(instance, disk, dev_path, seq):
1585
  """Hot add a nic
1586

  
1587
  """
1588
  hyper = hypervisor.GetHypervisor(instance.hypervisor)
1589
  return hyper.HotAddDisk(instance, disk, dev_path, seq)
1590

  
1591
def HotDelDisk(instance, disk, seq):
1592
  """Hot add a nic
1593

  
1594
  """
1595
  hyper = hypervisor.GetHypervisor(instance.hypervisor)
1596
  return hyper.HotDelDisk(instance, disk, seq)
1597

  
1598
def HotAddNic(instance, nic, seq):
1599
  """Hot add a nic
1600

  
1601
  """
1602
  hyper = hypervisor.GetHypervisor(instance.hypervisor)
1603
  return hyper.HotAddNic(instance, nic, seq)
1604

  
1605
def HotDelNic(instance, nic, seq):
1606
  """Hot add a nic
1607

  
1608
  """
1609
  hyper = hypervisor.GetHypervisor(instance.hypervisor)
1610
  return hyper.HotDelNic(instance, nic, seq)
1611

  
1584 1612

  
1585 1613
def BlockdevCreate(disk, size, owner, on_primary, info, excl_stor):
1586 1614
  """Creates a block device for an instance.
b/lib/rpc_defs.py
283 283
    ("reinstall", None, None),
284 284
    ("debug", None, None),
285 285
    ], None, None, "Starts an instance"),
286
  ("hot_add_nic", SINGLE, None, constants.RPC_TMO_NORMAL, [
287
    ("instance", ED_INST_DICT, "Instance object"),
288
    ("nic", ED_NIC_DICT, "Nic dict to hotplug"),
289
    ("seq", None, "Nic seq to hotplug"),
290
    ], None, None, "Adds a nic to a running instance"),
291
  ("hot_del_nic", SINGLE, None, constants.RPC_TMO_NORMAL, [
292
    ("instance", ED_INST_DICT, "Instance object"),
293
    ("nic", ED_NIC_DICT, "nic dict to remove"),
294
    ("seq", None, "Nic seq to hotplug"),
295
    ], None, None, "Removes a nic to a running instance"),
296
  ("hot_add_disk", SINGLE, None, constants.RPC_TMO_NORMAL, [
297
    ("instance", ED_INST_DICT, "Instance object"),
298
    ("disk", ED_OBJECT_DICT, "Disk dict to hotplug"),
299
    ("dev_path", None, "Device path"),
300
    ("seq", None, "Disk seq to hotplug"),
301
    ], None, None, "Adds a nic to a running instance"),
302
  ("hot_del_disk", SINGLE, None, constants.RPC_TMO_NORMAL, [
303
    ("instance", ED_INST_DICT, "Instance object"),
304
    ("disk", ED_OBJECT_DICT, "Disk dict to remove"),
305
    ("seq", None, "Disk seq to hotplug"),
306
    ], None, None, "Removes a nic to a running instance"),
286 307
  ]
287 308

  
288 309
_IMPEXP_CALLS = [
b/lib/server/noded.py
574 574
    return backend.StartInstance(instance, startup_paused)
575 575

  
576 576
  @staticmethod
577
  def perspective_hot_add_disk(params):
578
    """Hotplugs a nic to a running instance.
579

  
580
    """
581
    (idict, ddict, dev_path, seq) = params
582
    instance = objects.Instance.FromDict(idict)
583
    disk = objects.Disk.FromDict(ddict)
584
    return backend.HotAddDisk(instance, disk, dev_path, seq)
585

  
586
  @staticmethod
587
  def perspective_hot_del_disk(params):
588
    """Hotplugs a nic to a running instance.
589

  
590
    """
591
    (idict, ddict, seq) = params
592
    instance = objects.Instance.FromDict(idict)
593
    disk = objects.Disk.FromDict(ddict)
594
    return backend.HotDelDisk(instance, disk, seq)
595

  
596
  @staticmethod
597
  def perspective_hot_add_nic(params):
598
    """Hotplugs a nic to a running instance.
599

  
600
    """
601
    (idict, ndict, seq) = params
602
    instance = objects.Instance.FromDict(idict)
603
    nic = objects.NIC.FromDict(ndict)
604
    return backend.HotAddNic(instance, nic, seq)
605

  
606
  @staticmethod
607
  def perspective_hot_del_nic(params):
608
    """Hotplugs a nic to a running instance.
609

  
610
    """
611
    (idict, ndict, seq) = params
612
    instance = objects.Instance.FromDict(idict)
613
    nic = objects.NIC.FromDict(ndict)
614
    return backend.HotDelNic(instance, nic, seq)
615

  
616
  @staticmethod
577 617
  def perspective_migration_info(params):
578 618
    """Gather information about an instance to be migrated.
579 619

  

Also available in: Unified diff