Place the peeled onions in a glass or ceramic bowl and cover with cold water.
Drain the water into a saucepan and stir in the salt. Bring just to a boil so that the salt dissolves, then cool slightly and pour over the onions. Cover the bowl with a heavy plate so all of the onions stay submerged. Leave onions to stand for 24 hours.
Measure the vinegar into a saucepan. Tie the pickling spice into a cloth and add to the vinegar along with the bay leaves. Bring to a boil, then simmer over low heat for 5 minutes.
Rinse the onions and pat them dry.
Add to the saucepan with the vinegar. Simmer for 2 to 3 minutes. Pack the onions into sterile jars and ladle the brine over them until they are covered.
Add a dried chile pepper to each jar if you like. Seal with sterile lids and rings and store in a cool dark place for at least 6 weeks before opening.