@depends(HAS_PYVMOMI)
def vmotion_enable(host, username, password, protocol=None, port=None, host_names=None, device='vmk0'):
 service_instance = salt.utils.vmware.get_service_instance(host=host, username=username, password=password, protocol=protocol, port=port)
 host_names = _check_hosts(service_instance, host, host_names)
 ret = {}
 for host_name in host_names:
  host_ref = _get_host_ref(service_instance, host, host_name=host_name)
  vmotion_system = host_ref.configManager.vmotionSystem
  try:
   vmotion_system.SelectVnic(device)
  except vim.fault.HostConfigFault as err:
   msg = 'vsphere.vmotion_disable failed: {0}'.format(err)
   log.debug(msg)
   ret.update({host_name: {'Error': msg, 'VMotion Enabled': False}})
   continue
  ret.update({host_name: {'VMotion Enabled': True}})
 return ret

@ depends ( HAS_PYVMOMI ) def vmotion_enable ( host , username , password , protocol = None , port = None , host_names = None , device = 'vmk0' ) : service_instance = salt . utils . vmware . get_service_instance ( host = host , username = username , password = password , protocol = protocol , port = port ) host_names = _check_hosts ( service_instance , host , host_names ) ret = { } for host_name in host_names : host_ref = _get_host_ref ( service_instance , host , host_name = host_name ) vmotion_system = host_ref . configManager . vmotionSystem try : vmotion_system . SelectVnic ( device ) except vim . fault . HostConfigFault as err : msg = 'vsphere.vmotion_disable failed: {0}' . format ( err ) log . debug ( msg ) ret . update ( { host_name : { 'Error' : msg , 'VMotion Enabled' : False } } ) continue ret . update ( { host_name : { 'VMotion Enabled' : True } } ) return ret
enable vmotion for a given host or list of host_names .