Cook the pasta according to the instructions on the packet, do not let it drain completely.
Dice the onion and ham, fry in oil until light brown. Stir in sour cream, simmer a little. Add the cooked pasta, sprinkle with the grated cheese, stir until the cheese has melted.