Arrange the oven racks so that they oven is divided into thirds. Preheat oven to 425 degrees F. On a large rimmed baking sheet, toss together garlic, broccoli, onion, oil, and season with salt and pepper. Roast on the top rack in the preheated oven for 25 to 30 minutes.
Place the bacon on a another rimmed baking sheet. Put the bacon on the lower rack after the veggies have roasted for about 5 minutes. The bacon will cook 20 to 25 minutes, but check on it often after about 15 minutes so that it does not burn.
While the veggies and bacon are in the oven, cook the pasta according to the package directions. Reserve 3/4 cup of the cooking liquid before draining. Return the pasta to the pot, or put in a large serving bowl. Add the Parmesan cheese and 1/2 cup of the reserved cooking liquid. Stir well, and add more liquid if the pasta looks dry.
Add the veggies and bacon to the pasta. Toss to combine, and serve.