def get_resources_vms(call=None, resFilter=None, includeConfig=True):
 log.debug('Getting resource: vms.. (filter: {0})'.format(resFilter))
 resources = query('get', 'cluster/resources')
 ret = {}
 for resource in resources:
  if (('type' in resource) and (resource['type'] in ['openvz', 'qemu', 'lxc'])):
   name = resource['name']
   ret[name] = resource
   if includeConfig:
    ret[name]['config'] = get_vmconfig(ret[name]['vmid'], ret[name]['node'], ret[name]['type'])
 if (resFilter is not None):
  log.debug('Filter given: {0}, returning requested resource: nodes'.format(resFilter))
  return ret[resFilter]
 log.debug('Filter not given: {0}, returning all resource: nodes'.format(ret))
 return ret

def get_resources_vms ( call = None , resFilter = None , includeConfig = True ) : log . debug ( 'Getting resource: vms.. (filter: {0})' . format ( resFilter ) ) resources = query ( 'get' , 'cluster/resources' ) ret = { } for resource in resources : if ( ( 'type' in resource ) and ( resource [ 'type' ] in [ 'openvz' , 'qemu' , 'lxc' ] ) ) : name = resource [ 'name' ] ret [ name ] = resource if includeConfig : ret [ name ] [ 'config' ] = get_vmconfig ( ret [ name ] [ 'vmid' ] , ret [ name ] [ 'node' ] , ret [ name ] [ 'type' ] ) if ( resFilter is not None ) : log . debug ( 'Filter given: {0}, returning requested resource: nodes' . format ( resFilter ) ) return ret [ resFilter ] log . debug ( 'Filter not given: {0}, returning all resource: nodes' . format ( ret ) ) return ret
retrieve all vms available on this environment cli example: .