Spaceinvader One server backup scripts modification for IPMI


Recommended Posts

Spaceinvader One's latest video on server backup/failover inspired me to do some tweaks to my setup.  I backup share data from one unRAID server to another once a week.  His video inspired me to make my setup a full failover scenario as far as my Plex media is concerned.

 

His backup scripts appear to be powering on and off the servers via smartplugs. 

 

In my case, both my main and backup servers have IPMI-enabled motherboards so I find it easy to power the servers on and off that way.

 

A great way to do this is to install ipmitool from the Nerd Tools plugin.

 

Once installed, you can just call ipmitool with some parameters to power on or off the desired server.  Here are some examples:

 

Power on a server

ipmitool -I lan -H {BMC IP address of server to power on} -U {IPMI admin user name} -P {IPMI admin user password} chassis power on

 

Power off a server gracefully

ipmitool -I lan -H {BMC IP address of server to power off} -U {IPMI admin user name} -P {IPMI admin user password} chassis power soft

 

Note the IP address to use is the IP address assigned to the BMC NIC, not the server eth0 IP address.  On some motherboards the same NIC may be shared by the BMC and eth0.

 

Notes on chassis power states:

 

soft (clean/graceful shutdown - no parity check forced on next startup)

Initiate a soft-shutdown of OS via ACPI. This can be done in a number of ways, commonly by simulating an overtemperture or by simulating a power button press. It is necessary for there to be Operating System support for ACPI and some sort of daemon watching for events for this soft power to work.

 

off (unlcean shutdown.  Will start a parity check on array startup)

Power down chassis into soft off (S4/S5 state). WARNING: This command does not initiate a clean shutdown of the operating system prior to powering down the system

 

If you choose to use the great scripts from Spaceinvader One but you have IPMI capable servers, you can modify the scripts to call ipmitool instead of powering on or off a smartplug.

Edited by Hoopster
  • Like 3
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.