I installed CDH 5.9.0 in Azure Virtual Machine. Every time I restart the VM, Name Node failed to restart due to Name Node not formatted issue. It seems that the cluster can't remember what has bee done after each VM restart. I had to format the Name Node all over again. I check data.dir and name.dir, and they are all defined.
There is a similar issue found, but I installed CDH manually via CM, not using any template.
http://stackoverflow.com/questions/36140311/cloudera-start-services-namenode-not-formatted/36391569