If you have a smell problem, first run the cold water by itself and check it. Then run the hot water by itself and check it.
This condition may be caused by a biochemical reaction caused by:
sulphates in the water
sulphate reducing bacteria
a magnesium rod in the hot water heater
organic matter in the water.
If the odor problem in the water heater is caused by heat loving sulphate reducing bacteria, disinfect the water heater with chlorine bleach or hydrogen peroxide.
Sometimes the reaction with the magnesium rod is the cause of odor problem. The purpose of the magnesium rod is to prevent corrosion of the water heater. Removing the magnesium rod will often prevent the odor problem, but will void the warranty and lead to the possible earlier deterioration of the tank. If corrosion is a concern, the magnesium rod can be replaced with a zinc rod.
Try disinfecting the tank with chlorine bleach or hydrogen peroxide first before using any of the more drastic measures.
Another thing to try is to turn up the temperature on the heater. Temperatures 140F and above may kill the bacteria and solve the problem.