In a large bowl, toss the beets, shallots, and rosemary with the olive oil. Place into a foil pouch and roast in the oven for 40 minutes.
Remove the skin from the roasted beets and thinly slice. Arrange in 1-quart jars, alternating layers with the onion. In a small pot, boil the rest of the ingredients and pour over the beets. Tightly lid the jars and place in the refrigerator for 3 to 7 days before serving.