Preheat the oven to 350 degrees and lightly grease a large baking dish.
Stir the brown sugar and Dijon mustard together in a small bowl to make the glaze. Spread it evenly over the ham and set the ham in the baking dish.
Melt the butter in a medium saucepan over medium heat. Whisk in the flour and cook for one minute. Slowly pour in the milk while whisking until the sauce thickens. Stir in the salt, pepper, and half the cheddar cheese.
Layer half the sliced potatoes and onion in the baking dish around the ham. Pour half the sauce over them. Repeat with the remaining potatoes, onion, and sauce. Sprinkle the rest of the cheddar cheese on top.
Cover the dish with foil and bake for 45 minutes. Remove the foil and bake for another 20 minutes until the potatoes are soft and the top is lightly browned.