A glassy state of matter results if crystallization is avoided upon cooling or increasing density. However, the physical factors controlling the ease of vitrification and nature of the glass transition remain elusive. Using numerical simulations of polydisperse hard disks, we find a direct relation between medium-range crystalline ordering and the slow dynamics which characterizes the glass transition. This suggests an intriguing scenario that the strength of frustration controls both the ease of vitrification and nature of the glass transition. Vitrification may be a process of hidden crystalline ordering under frustration, at least in our system.