Hi David,
Online disk shelf removal is only supported from ONTAP 8.2 onwards. Since a FAS2040 is not able to run 8.2, the official answer is that this is an unsupported action.
This being said, I've seen it work on systems with 8.1 and lower on it. And since you are slowly decommissioning the FAS2040, you may decide it's worth the risk of hot-removing some shelves...
In any event, the official procedure requires you to destroy any aggregates on the diskshelves to be removed first, and unown all disks before removing a diskshelf. If you want to remove one shelf at a time, you may require several disk move commands to free up one shelf.
Additionally, removing shelves must take into account that FCAL/SAS access to the other shelves must be maintained at all times. This is generally where MPHA comes into play.
Best regards,
Filip