This thesis proposes an adaptive system to allocate virtual machines in a cloud environment to reduce clients' waiting time while reducing the idle resources for the service provider. Further, the thesis demonstrates the viability of the proposed system via a prototype built using the Citrix XenServer and a machine learning algorithm which makes the system capable of working with minimum human interactions. The proposed architecture is designed in collaboration with and based on the requirements of DLS Technology so that they can migrate their flagship product (vKey) to a cloud environment keeping security and performance as a priority. The incoming requests from clients are handled by a pool manager which takes smart decisions thus making the user experience seamless. A performance analysis of the prototype is carried out to prove the effectiveness of the proposed strategies.