In large pot cook the pasta according to the package directions.
In another large pot on the stove top, melt the butter over medium heat.
Once the butter is completely melted, sauté the onions until clear and tender. This should take about four minutes.
Once the onions are tender, add the sliced mushrooms and cook until your desired texture is reached. About four minutes for tender mushrooms.
Place the onions and mushrooms in a small bowl and set aside.
Add the remaining butter to the pot and melt it.
Once melted, whisk the flour into the butter to make a roux.
Allow the roux to bubble and then whisk in the milk.
Season the cream sauce with salt, pepper, and thyme and then allow it to simmer for 8 minutes or until thickened.
Slowly stir in the chicken broth.
Add the pasta, green peas, and cooked ham until ingredients are warm and thoroughly coated in the sauce.
Turn the oven on broil.
Pour the pasta mixture into an 8x8 casserole dish, and sprinkle the top with grated parmesan cheese.
Broil until the top is golden brown, or for about two minutes.