1. Set oven rack at the lowest level; preheat to 450 degrees. Combine onions, shallots, garlic and oil in a large shallow roasting pan. Roast for 20 to 25 minutes, stirring every 5 minutes, or until the onions are golden.
2. Remove from oven and pour in one-fourth of the chicken stock. Stir liquid in the pan, scraping the bottom to loosen and dissolve any caramelized bits. (The liquid will become quite dark.)
3. Transfer the onion mixture to a soup pot and add brandy, thyme and the remaining chicken stock. Bring to a boil; reduce heat to low and simmer, covered, for 30 minutes.
4. Season with salt and pepper and top with Parmesan cheese.