Revision 3b7158ef

b/lib/rapi/client.py
718 718
                             ("/%s/instances/%s" %
719 719
                              (GANETI_RAPI_VERSION, instance)), query, None)
720 720

  
721
  def ModifyInstance(self, instance, **kwargs):
722
    """Modifies an instance.
723

  
724
    More details for parameters can be found in the RAPI documentation.
725

  
726
    @type instance: string
727
    @param instance: Instance name
728
    @rtype: int
729
    @return: job id
730

  
731
    """
732
    body = kwargs
733

  
734
    return self._SendRequest(HTTP_PUT,
735
                             ("/%s/instances/%s/modify" %
736
                              (GANETI_RAPI_VERSION, instance)), None, body)
737

  
721 738
  def GetInstanceTags(self, instance):
722 739
    """Gets tags for an instance.
723 740

  
b/qa/ganeti-qa.py
162 162

  
163 163
  if qa_config.TestEnabled('instance-modify'):
164 164
    RunTest(qa_instance.TestInstanceModify, instance)
165
    if qa_rapi.Enabled():
166
      RunTest(qa_rapi.TestRapiInstanceModify, instance)
165 167

  
166 168
  if qa_config.TestEnabled('instance-console'):
167 169
    RunTest(qa_instance.TestInstanceConsole, instance)
b/qa/qa_rapi.py
358 358
    _WaitForRapiJob(_rapi_client.RenameInstance(name1, name2))
359 359

  
360 360

  
361
def TestRapiInstanceModify(instance):
362
  """Test modifying instance via RAPI"""
363
  def _ModifyInstance(**kwargs):
364
    _WaitForRapiJob(_rapi_client.ModifyInstance(instance["name"], **kwargs))
365

  
366
  _ModifyInstance(hvparams={
367
    constants.HV_KERNEL_ARGS: "single",
368
    })
369

  
370
  _ModifyInstance(beparams={
371
    constants.BE_VCPUS: 3,
372
    })
373

  
374
  _ModifyInstance(beparams={
375
    constants.BE_VCPUS: constants.VALUE_DEFAULT,
376
    })
377

  
378
  _ModifyInstance(hvparams={
379
    constants.HV_KERNEL_ARGS: constants.VALUE_DEFAULT,
380
    })
381

  
382

  
361 383
def TestInterClusterInstanceMove(src_instance, dest_instance, pnode, snode):
362 384
  """Test tools/move-instance"""
363 385
  master = qa_config.GetMasterNode()

Also available in: Unified diff