power cycle from command line...

October 27, 2013 19.9k views
Hi, all. I've just taken a snapshot of a droplet & was informed: `We recommend rebooting your droplet through the command line, as this action is the same as hard resetting the server and may cause data corruption`. I didn't think it was possible to reboot a server from cold via the cli (unless you used ethtool). Does anybody know the procedure for this? Any help appreciated. Cheers, Phil...
10 Answers

I had the same thought as Phil. I shutdown the droplet and took a snapshot. My mental model tells me that I should now need to boot the droplet. This is not true. It automatically restarted after the snapshot. It doesn't help that the next thing we see is the "We recommend rebooting from the command line" message.

If you're seeing that message, then the server is on. Above the 'Power' tab, you should see the server IP and status 'Active.'

it doesn't reboot automatically hence the message I first posted...
I think they just mean shutting your droplet down from the command line before taking the snapshot.
On Ubuntu, you can shutdown your droplet from the command line by executing sudo shutdown -h now;

To reboot, sudo reboot now.
`sudo shutdown -hP now`, please ;-) I don't know about KVM, but virtualbox won't register a VM as off if it's only halted, not powered off.
if the image is powered off, you can't ssh into it to get a prompt in order to issue the reboot command, can you?
Once the snapshot is taken, the system will automatically boot up your droplet, allowing you to SSH into it once again.
It's supposed to (or, at least it has for me whenever I've taken a snapshot in the past). Perhaps you should open a support ticket.
You can just log into the control center UI and boot from there.

Would be useful if DO would link to the article how you can power down a Droplet from the command line. Seems to be sudo shutdown -hP now. I did and could no longer ssh into box. But I did not see status powered down from the DO Dashboard. Took a snapshot anyways. And then was told this can take up to an hour. Waited for about 5-10 minutes for it to be done. Basic Ubuntu 16.0.4 box running NGINX, PHP and MariaDB and one bare WordPress site. After snapshot was done I could immediately ssh into box. Not sure yet how I can verify the snapshot is functional or not.

Have another answer? Share your knowledge.