I did 5 nights/4 days in Fez, with a day trip to Meknes and the Roman ruins, and 4nights/4days in Marrakech with a day trip to the Atlas mountains.
Felt like I saw a lot. Had no desire to see Casablanca. Skip Casablanca and 9 nights will be perfect.
There is a hard to find airline Air Arabia, that flies between Fez and Marrakech. I don't think it flies daily, but plan accordingly. It was delayed but decent enough and a huge time saver.