Ethernet is being increasingly employed in metro networks. Ethernet gives routing schemes and protocols for building up trees, for instance STP, RSTP and MSTP. It also implies simple restoration mechanisms. In this paper we propose an optimization framework, where the Ethernet MSTP trees are protected and QoS is guaranteed even after a failure. The optimization is based not only on the topology, but it also takes traffic conditions and QoS constraints into account. The numerical results show that the proposed optimization significantly increases the throughput of the network. The best result can be achieved when preemption is assumed, i.e., when the best effort traffic may remain unprotected, but not the high priority one. This way high throughput can be realized at normal operation, while it still protects prioritized traffic in case of a failure. Furthermore, protection mechanisms act faster than the standard restoration mechanism resulting shorter out-of-service times, and therefore higher availability.