The best way to check if the smell is coming from your hot water cylinder is to run a cold tap and see if it has an odour. If not, then the issue is coming from the warm water in the cylinder. Smelly or discoloured cold water will mean that the issue lies with the mains water supply.
Hot water that’s discoloured or has a dodgy smell can be the result of the cylinder’s anode rod (which helps to prevent corrosion) and water with a high concentration of sulphates. To resolve this, the cylinder may need to be flushed, have its anode replaced or be completely replaced.
Flushing the cylinder will help to get rid of the smell-causing sulphates but the smell is likely to remain.