An article of manufacture comprising non-transitory computer storage medium storing computer readable program code which, when executed by a computer, implements a method as implemented in a controller attached to a convergence gateway in a software-defined network (SDN), the controller controlling at least a first network switch and a second network switch that are part of the SDN, a first platform hosting a first virtual function collocated with the first network switch and a second platform hosting a second virtual function collocated with the second network switch, an orchestrator managing the first and second virtual functions, the medium comprising:
- (a) computer readable program code determining an optimal routing path for a traffic flow passing through said first network switch, with the traffic flow requiring to visit the second virtual function at the first network switch;
- (b) computer readable program code sending a request to the convergence gateway to move the second virtual function at the second platform hosting the second virtual function at the second network switch onto the first platform hosting the first virtual function at the first switch location,
- wherein the convergence gateway forwards the request to the orchestrator which moves the second virtual function at the second platform hosting the second virtual function at the second network switch onto the first platform hosting the first virtual function at the first switch location.