def vb_stop_vm(name=None, timeout=10000, **kwargs):
 vbox = vb_get_box()
 machine = vbox.findMachine(name)
 log.info('Stopping machine %s', name)
 session = _virtualboxManager.openMachineSession(machine)
 try:
  console = session.console
  progress = console.powerDown()
  progress.waitForCompletion(timeout)
 finally:
  _virtualboxManager.closeMachineSession(session)
  vb_wait_for_session_state(session)
 log.info('Stopped machine %s is now %s', name, vb_machinestate_to_str(machine.state))
 return vb_xpcom_to_attribute_dict(machine, 'IMachine')

def vb_stop_vm ( name = None , timeout = 10000 , ** kwargs ) : vbox = vb_get_box ( ) machine = vbox . findMachine ( name ) log . info ( 'Stopping machine %s' , name ) session = _virtualboxManager . openMachineSession ( machine ) try : console = session . console progress = console . powerDown ( ) progress . waitForCompletion ( timeout ) finally : _virtualboxManager . closeMachineSession ( session ) vb_wait_for_session_state ( session ) log . info ( 'Stopped machine %s is now %s' , name , vb_machinestate_to_str ( machine . state ) ) return vb_xpcom_to_attribute_dict ( machine , 'IMachine' )
tells virtualbox to stop a vm .