Yorkshire were beaten in Yorkshire Bank 40 Group C despite a quickfire 53 from Jonny Bairstow and a partnership of 93 between Gary Ballance and skipper Andrew Gale
Skipper Marcus North top-scored with 68 as Glamorgan won by 28 runs at Colwyn Bay.
Glamorgan made 285 for seven with Will Bragg and Chris Cooke also scoring half centuries.
But Yorkshire could only make 257 all out in reply.
Bragg and Cooke showed attacking intent with the Glamorgan 100 coming up from 15.2 overs and Bragg going to a 48-ball 50.
But Bragg was bowled by Pyrah leaving Glamorgan 105 for two in the 17th over.
Cooke registered a 46-ball 50 with seven fours, but he failed to build on to a good start when he was caught and bowled by Steve Patterson for 58.
Glamorgan’s hopes of getting towards 300 were dashed when Murray Goodwin (45) and Graham Wagg were out to consecutive deliveries from Pyrah, who was the pick of the Yorkshire attack with four for 43.
Yorkshire were stunned when Wagg dismissed Phil Jaques and Joe Root in the space of three balls in the second over of their reply.
Ballance and Gale began patiently rebuilding before the introduction of Cosker paid dividends when Ballance was stumped off a wide with his first ball.
Bairstow cracked three fours off a Michael Reed over to ease the increasing pressure and then hit Wagg for a four and a six from two balls as 16 came off the over. But Glamorgan fought back as Gale was trapped leg before attempting to sweep Cosker.
Bairstow reached a 34 ball 50 with seven fours and a six before Pyrah holed out on the boundary to give Cosker his third victim.
Yorkshire needed 105 off 63 balls, but Michael Hogan dismissed dangerman Bairstow. Rashid ended with 42 not out from 28 balls.