If it looks like an onion, (Onions are layered.) and smells like an onion, it is an onion. Yes, onions are edible.
Some things that look like onions have a solid bulb. Be careful there, some are poisonous. These do not have the onion smell.
Gardening at 5000 feet elevation, zone 4/5 Northern Utah, Frost free from May 25 to September 8 +/-