Both men retired on 105 as they punished a tiring students attack.
Donald, 19, is the second youngest player to reach three figures for Glamorgan.
The record is still held by Mike Llewellyn, who was aged 18 when he scored a century against Cambridge University in 1972.
Donald had previously made 98 in the final game of the 2015 season against Gloucestershire.
"It was nice to tick it off, it's been looming over me a bit during the winter.  It's really special, nice to get over the line in the first game of the season," Donald told BBC Wales Sport.
"Pleased for Dai as well, to have two maiden first-class tons in one game was a pretty good effort."
Lloyd, whose previous best was 92 at Northampton in 2015, reached his century with a six.
"I was just pleased to get over the line, and for Aneurin as well," he said.
"Last season was a stepping stone for me and hopefully I can go one step further with bat and ball."
The pair's run-scoring feats are likely to provide a difficult selection decision for Glamorgan's Championship opener against Leicestershire, with South Africa international batsman Colin Ingram yet to come into the side.
"Hopefully we've put ourselves up there for selection. It's about being in the mix, and you can't ask any more of ourselves to both get hundreds," said Donald.
"We accept this year there's going to be more competition for places which is a great thing for the club, pushing us as batters and bowlers."
Donald could still beat Matthew Maynard's record for the youngest Championship century, achieved in 1985.
Earlier Glamorgan's top order had all spent time at the wicket without going on to make big scores, as James Turpin and Alex Thomson claimed two wickets apiece.
The run-scoring exploits came after day one of the three-day match was washed out.
Glamorgan batsmen Aneurin Donald and David Lloyd both hit maiden first-class centuries as they piled up 444-7 against Cardiff MCCU.