code: def _determine_resource_pool(session, vm_):
      '''
      Called by create() used to determine resource pool
      '''
      resource_pool = ''
      if 'resource_pool' in vm_.keys():
          resource_pool = _get_pool(vm_['resource_pool'], session)
      else:
          pool = session.xenapi.pool.get_all()
          if not pool:
              resource_pool = None
          else:
              first_pool = session.xenapi.pool.get_all()[0]
              resource_pool = first_pool
      pool_record = session.xenapi.pool.get_record(resource_pool)
      log.debug('resource pool: %s', pool_record['name_label'])
      return resource_poof _determine_resource_pool(session, vm_):
      '''
      Called by create() used to determine resource pool
      '''
      resource_pool = ''
      if 'resource_pool' in vm_.keys():
          resource_pool = _get_pool(vm_['resource_pool'], session)
      else:
          pool = session.xenapi.pool.get_all()
          if not pool:
              resource_pool = None
          else:
              first_pool = session.xenapi.pool.get_all()[0]
              resource_pool = first_pool
      pool_record = session.xenapi.pool.get_record(resource_pool)
      log.debug('resource pool: %s', pool_record['name_label'])
      return resource_pool
docs: Called by create() used to determine resource pool