Order by id when the number of resources is equal

nodeid depends directly from how old the node is
Merge pull request #996 from Zentyal/ejhernandez/active-node-ord-by-id

Order by id when the number of resources is equal