Datacenters using cloud computing have already gotten a strong foothold as a utility service in ICT environment. The challenge is however, these powerful machines inside the unremarkable looking buildings consume a huge amount of energy. The problem statement is addressed by developing a technique at which optimal power is achieved to demonstrate how optimization of energy can be possible. This is done by identifying the ranges of CPU frequency at which optimal power is achieved. Secondly, it is also addressed with combination of virtual machine to the servers. The results show that energy can be optimized at the point where optimal power is achieved. Reducing the CPU frequency by 20% from the default maximum CPU frequency of servers give rise to an energy efficiency of up-to 13%. Moreover, results also showed that with combination of virtual machine gives a better chance of energy optimization possibilities up-to 16%. A better optimization of energy can also be possible by combining many other techniques like hardware capacities and virtualization, prototype algorithm with virtualization.