Slice the tops off of the onions, and remove the outer layer of skin. Leave the base intact. Cut slices across the top in a cross hatch pattern, going about 1/2 inch into the onion. Set each onion on a square of heavy duty aluminum foil. Double the foil if you do not have the heavy duty. Place 1 tablespoon of butter on top of each onion, then place one bouillon cube onto the butter. Fold the foil up around the onion. When almost closed, place 3 ice cubes on top of the onion, and spoon 1 tablespoon of the sherry into each packet. Seal completely.
Place the packets on the grill, and cook for 40 to 45 minutes. Don't peek inside until the 40 minutes has passed. When the onions are cooked through, they will feel tender when you squeeze the packet. Open the foil up slightly, and place a slice of cheese on top of each one. Close the grill lid, and let the cheese melt into the onions for a minute.
Remove from the grill, and serve from the packets, or remove the onions to a serving bowl, and pour the stock from the packets in with them.