Hi,
Follow linkhttps://support.hpe.com/hpsc/doc/public/display?docId=emr_na-a00022365en_us .Its applicable for MSA 2040 also.
Physically to shut down the sequence is hosts (disconnecting host connections to MSA)>MSA controllers (unplug the power cords)>disk enclosures(power button on the rear end)
In between each step please make sure all drives are completely spun down and there is no LEd.Then proceed to disk enclosures and follow the same.
The power on will be in the reverse order.