Patent attributes
Techniques for migrating virtual machines in logical clusters based on demand for the applications are disclosed. In one example, a system may include a logical cluster that spans across a first datacenter located at a first site and a second datacenter located at a second site, the second datacenter being a replication of the first datacenter. The first datacenter may include a virtual machine executing an application. Further, the system may include a management node communicatively coupled to the first datacenter and the second datacenter. The management node may include a dynamic affinity policy engine to monitor the application running in the first datacenter, determine a demand for the application from the first datacenter and the second datacenter based on the monitoring, and recommend migration of the virtual machine hosting the application from the first datacenter to the second datacenter based on the demand for the application.