Revision 0eca8e0c lib/rpc.py

b/lib/rpc.py
260 260
    self._cfg = cfg
261 261
    self.port = utils.GetNodeDaemonPort()
262 262

  
263
  def _InstDict(self, instance):
263
  def _InstDict(self, instance, hvp=None, bep=None):
264 264
    """Convert the given instance to a dict.
265 265

  
266 266
    This is done via the instance's ToDict() method and additionally
......
268 268

  
269 269
    @type instance: L{objects.Instance}
270 270
    @param instance: an Instance object
271
    @type hvp: dict or None
272
    @param hvp: a dictionary with overriden hypervisor parameters
273
    @type bep: dict or None
274
    @param bep: a dictionary with overriden backend parameters
271 275
    @rtype: dict
272 276
    @return: the instance dict, with the hvparams filled with the
273 277
        cluster defaults
......
276 280
    idict = instance.ToDict()
277 281
    cluster = self._cfg.GetClusterInfo()
278 282
    idict["hvparams"] = cluster.FillHV(instance)
283
    if hvp is not None:
284
      idict["hvparams"].update(hvp)
279 285
    idict["beparams"] = cluster.FillBE(instance)
286
    if bep is not None:
287
      idict["beparams"].update(bep)
280 288
    return idict
281 289

  
282 290
  def _ConnectList(self, client, node_list, call):
......
425 433
    """
426 434
    return self._SingleNodeCall(node, "bridges_exist", [bridges_list])
427 435

  
428
  def call_instance_start(self, node, instance):
436
  def call_instance_start(self, node, instance, hvp, bep):
429 437
    """Starts an instance.
430 438

  
431 439
    This is a single-node call.
432 440

  
433 441
    """
434
    return self._SingleNodeCall(node, "instance_start",
435
                                [self._InstDict(instance)])
442
    idict = self._InstDict(instance, hvp=hvp, bep=bep)
443
    return self._SingleNodeCall(node, "instance_start", [idict])
436 444

  
437 445
  def call_instance_shutdown(self, node, instance):
438 446
    """Stops an instance.

Also available in: Unified diff