Caramelize the sugar in a large, wide saucepan until light brown. Fry the peeled small onions in one piece. Instead of the original Borrettane onions from Emilia Romagna, I used onions of the Stuttgart Giant variety. Incidentally, a variety that is rarely on the market, as it cannot be processed by machine. Unless you grow them yourself. But because of the dry weather, that turned out to be dwarfs. That made them the right size for the recipe.
When the onions have taken on a nice color and look browned, add the wine first and then add the balsamic vinegar after it has boiled. The onions must be completely covered with liquid. Now add the spices and simmer for 30 - 40 minutes, depending on the size of the onion. The onions shouldn't get too soft, they should still have bite.
Pour rinsed twist-off jars that are not too large while still hot and close immediately. The lid is then drawn in when the mass cools down inside. I do not think it is advisable to boil down additionally. The onions would be completely overcooked and even if the glass shouldn't close, the vinegar and sugar will always be preserved. The onions can be kept for 3 months. For me, however, they haven't gotten that old at all.