That's a slightly convoluted upgrade, so Heads up:
the stock internal 3.5" HDD's have a new type specialty in-line thermal temperature sensor cable, and improper reconnection or removing that is what causes the HDD's fans to go crazy or fail the Apple Hardware Test.
But most importantly, I believe the optical drive bay can only handle a 2.5" HD (or smaller) SSD: I think the 3.5" HD form factor is too fat for that optical bay space.
You have probably already found/googled "27-inch iMac (2011) Hard Drive Installation Video" to see the skill level and tools needed for proper and correct surgery for opening up the 2011 iMac 27".
Also, when you install an aftermarket SSD drive into a Mac, TRIM is not enabled, and you can research what software tools/commands you can use to enable that if you wish. And if after all your upgrades still cause your fans to go crazy, you can stabilize that thru the usage of a 'Fan Control' software for Mac OS X as a last resort.