Two slots -- one for the stored spell, and one for the Glyph (which must be the same level slot (or higher) as the spell being stored).
The Spell Glyph option of the Glyph of Warding spell (PHB, p. 246-247) states:
You can store a prepared spell of 3rd level or lower in the glyph by casting it as part of creating the glyph. [...] The spell being stored has no immediate effect when cast in this way. When the glyph is triggered, the stored spell is cast. [...]
Both slots are expended when the Glyph with the stored spell is created, as that is when the spell caster is casting both spells.
There's nothing in the spell description that says it allows an extra spell to be cast and stored without using a spell slot. Using a spell slot is how casting and storing spells both normally work (per p. 201 of the PHB), so that's the general rule, and it holds unless a specific rule says otherwise for a particular application - which in this case it does not.