I had an issue with a power button not working recently. I took the whole machine apart, removed the power button and glued it back in to place, now it works fine. I believe the issue was that the ring between the outer button and the inner part fell out of place and wasn't letting the power button be properly depressed. It's very important to test the button and hear the click when you press it when you glue it back in to place to make sure it is perfectly centered otherwise it will not work.
I had this issue recently and after analyzing the schematics for the iMac 2011, I found that two tiny inductors (ferrite beads) in the ambient temperature sensors' path have been knocked off somehow and that caused the ambient temperature sensor not to work and in turn the system sped the fans up and slowed the cpu down. This issue has nothing to do with the hard drive it just happens to many people while they're disassembling the machine, the two inductors are right near the ambient temperature sensor connector (L5500 & L5501) and I guess can be knocked off easily. It can be fixed with some soldering skills and there's no need to remove the logic board for the repair. I don't think there is a need to replace the parts they're just there to reduce some radio frequency. If you do want to replace them they're both a 220 ohm ferrite bead SMT size 0402 (1005 metric). After my discovery I found some guys on a repair website mentioning a few times that they've dealt with this issue on the iMac 2011. That fix...