HEWLETT-PACKARD said it is investing more than $US1 billion ($1.07bn) over the next two years to develop cloud-computing software and tools, a move it considers necessary to ward off competition even if it means cannibalizing its legacy hardware and software businesses.