Resilient virtual topologies in optical networks and clouds