Preheat oven to 350 degrees F.
In a food processor fitted with the grater attachment, push chunks of potato through the chute to grate.
When all potatoes are grated, put them in a clean kitchen towel or cheesecloth and squeeze to remove the moisture.
Add potatoes to a large bowl and stir in olive oil; season well with salt, pepper and rosemary.
Spray a 12-cup muffin tin with non-stick spray; press trated potatoes evenly into muffin cups, making sure potates go up the sides of the cups to create a basket.
Bake potatoes for 35 to 40 minutes, or until the top edges turn light brown and the potatoes are cooked through.
Remove potatoes from oven and gently crack an egg into each cup.
Return to oven and bake until eggs become firm, approximately 10 minutes.
Garnish with onions, if desired, and serve.