Virtual IP in a swarm

The routing mesh works regardless which node you use to access a published port. If an overlay network is assign to your containers, it will be spun across all nodes that run at least one of those containers. Instead of working with IPs you should use the servicename or the network alias to access your container. Combined with a loadbalancer that checks the availability of the target nodes, this might be a solution. Though, it shifts the problem to the loadbalancer.

The question is: are you aiming for a virutal ip for the docker engine or for the container you are running?

There are docker containers that require NET_ADMIN capabilites using keepalived, to make the Docker Engine run on a static interface plus the additional virutal ip. Shifted from the master node to the slave node, once the mater is unavaible and back once it is available.