1. A method for performing management tasks in a virtual infrastructure that includes a plurality of hosts as managed objects, the method comprising: detecting a change, beyond a predetermined threshold, in a number of tasks waiting to be processed by a plurality of management modules executing as execution environments in the virtual infrastructure, each of the plurality of management modules being a management execution environments for the managed objects of the virtual infrastructure, wherein the change is either an increase or a decrease; if the detected change is a decrease, based on the detected decrease in the number of tasks waiting to be processed, selecting one or more management modules of the plurality of management modules to be removed; distributing managed objects handled by the selected one or more management modules to one or more non-selected management modules of the plurality of management modules; and removing the selected one or more management modules, if the detected change is an increase, spawning one or more additional management modules executing as execution environments in the virtual infrastructure; distributing managed objects handled by the first management module among the additional management modules; reallocating the tasks waiting to be processed among the first management module and the additional management modules; and processing the reallocated tasks by the corresponding management module.