Cook pasta in boiling salted water until al dente. Reserve 1/4 cup pasta water; drain pasta and return to pot. Meanwhile, in a large skillet, combine sliced large yellow onion with olive oil; season with salt and pepper. Cook over medium-high until beginning to brown, 3 to 5 minutes. Add sliced mushrooms; cook until browned, about 5 minutes. Add ham pieces; cook until warm. Toss with pasta, adding enough pasta water to create a sauce that coats pasta. Serve topped with chopped parsley and grated pecorino cheese.