Beyond that, though, I don't see anything wrong with this approach, provided that your environment can tolerate those servers being offline potentially longer than necessary (i.e. if a power outage lasts from 9-10 pm, but you don't start them back up until 8 am the next morning, that's 10 hours longer that they were off than they really needed to be), which your description seems to suggest is the case. In this environment, I don't think I would do anything differently, beyond also scheduling the host computer to shutdown a couple of minutes after the VMs are scheduled to do so.
发布评论
评论(1)
对于初学者来说, shutdown 命令本身可以直接花费一些时间,您不需要为此使用 at (请参阅 http://www.computerhope.com/unix/ushutdow.htm)。
不过,除此之外,我认为这种方法没有任何问题,只要您的环境可以容忍这些服务器离线时间可能超过必要时间(即,如果停电持续晚上 9 点到 10 点,但您不启动它们)直到第二天早上 8 点才回来,这比他们真正需要的时间长了 10 个小时),你的描述似乎表明情况就是如此。在这种环境中,除了安排主机在虚拟机计划关闭几分钟后关闭之外,我认为我不会做任何不同的事情。
For starters, the shutdown command can take a time directly itself, you don't need to use at for that (see http://www.computerhope.com/unix/ushutdow.htm).
Beyond that, though, I don't see anything wrong with this approach, provided that your environment can tolerate those servers being offline potentially longer than necessary (i.e. if a power outage lasts from 9-10 pm, but you don't start them back up until 8 am the next morning, that's 10 hours longer that they were off than they really needed to be), which your description seems to suggest is the case. In this environment, I don't think I would do anything differently, beyond also scheduling the host computer to shutdown a couple of minutes after the VMs are scheduled to do so.