Ocassionally one of my remote windows servers locks up and must be restarted by pressing the restart button on the front of the case. Since I work remotely I call a coworker to press the button.
I would prefer to restart the machine remotely by cycling the power using a web-controlled smart relay switch (such as this). But I am concerned about harming the spinning disks with a power cycle.
Is cycling power worse for a server than pressing the reset button on the chasis?
The reset-button is much preferred as it is electrically speaking much easier on the components in the server.
The reset-button on the server will usually just reset the motherboard. So the disks keep spinning (no power-cycling there) and the motherboard will reboot.
A smart-relay (or the on/off button on the server) will cut power completely which will also cause the disks (and the power-supply) to power-cycle.
As others already stated: Data-loss will most likely not occur in either case as disks these days are constructed such that a head-crash doesn't happen anymore.
Off course: If you application is hosed to the point of requiring a reboot it is anybody's guess if the data used/generated by that application can be trusted to be consistent. I would worry more about that, than about any potential damage due to the reboot.
The relay operated switch is unlikely to cause damage any worse the toggling the switch on the computer power-supply. It certainly isn't something that you would want to do frequently, or when the system was working normally and in the middle of actually reading or writing to the drive.
No, 20 years ago cutting the power would cause a head crash, but nowadays disks are a bit smarter.
Cutting the power in the middle of a write operation is not so clear cut - Journalling file systems ensure the integrity of the file and most DBMS will handle it sensibly too. But if the server has locked up already this isn't an issue anyway.
But rather than mess around with ways of cutting the power go buy a networked UPS. You'll get better line conditioning, uptime during short outages and controlled shutdown for prolonged outages.