Cook the pasta in 3-4 l boiling salted water according to the instructions on the packet. Drain onions and collect the stock. Cut onions in half. Wash and halve the tomatoes. Heat oil in a large pan. Fry the ham until crispy.
Fry the tomatoes and onions briefly. Add the onion stock and simmer over a high heat for about 5 minutes.
Drain the pasta and mix with the onion mix. Season to taste with pepper. Slice parmesan cheese over it.