The virtualization has been considered as one of core technologies in cloud computing to overcome low efficiency of resource utilization for physical machines by multiplexing operating systems and/or applications on physical servers in a form of virtual machine. However, efficient algorithm and policy are required in order to map virtual machines to physical machines dynamically and to support efficient consolidation or load balancing for virtual machines. In addition, when the server environment is configured with servers with heterogeneous capabilities, these allocation algorithm and mapping policy are essential for efficient server operations. In this paper, we introduce an efficient dynamic allocation algorithm for virtual machines in heterogeneous server environment that works based on more accurate resource allocation priority than previous methods. Our proposed algorithm provides efficient allocation of virtual machines based on this priority. The evaluation supports the efficiency of our algorithm both for consolidation and load balancing of virtual machines in heterogeneous server environment.