What you have there is a simile rather than a metaphor or an idiom.
As noted in the wikipedia articles linked above,
A simile is a figure of speech that directly compares two different things, usually by employing the words "like" or "as".
A metaphor is a literary figure of speech that describes a subject by asserting that it is, on some point of comparison, the same as another otherwise unrelated object.
An idiom ... is an expression, word, or phrase that has a figurative meaning that is comprehended [as] separate from the literal meaning or definition of the words of which it is made.