Virtualization technology is widely used in cloud datacenters to realize on-demand resources allocation so as to lower operating costs. Moreover, the technology can also improve the flexibility and scalability of datacenters. Despite various merits, these features of virtualization technology also introduce an issue about how to allocate the virtual machines to make the best of physical resources while reducing the resource collision rate in the meantime. To this end, this paper proposes two resource allocation methods for virtual machines based on statistical analysis of history data. Combined with commonly-used placement strategies, these two methods are more effective compared with some state-of-art virtual machine resource allocation methods. In addition, existing independent indicators are incomplete to reflect the overall effectiveness of allocation methods. In order to solve the issue, this paper also proposes an integrated effectiveness indicator which combines different indicators from three separate aspects including the number of consumed physical machines, resource utilization and resource collision of physical machines to evaluate the effectiveness of allocation schemes. In the end, through tests of realistic cloud computing overhead, we prove that the proposed allocation methods of virtual machines are superior to common methods, and the integrated effectiveness indicator can reasonably evaluate the overall effectiveness of virtual machine allocation schemes.