Changes between Initial Version and Version 1 of how-to/servers/reboot-physical-host


Ignore:
Timestamp:
May 18, 2013, 11:08:27 PM (12 years ago)
Author:
Ross
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • how-to/servers/reboot-physical-host

    v1 v1  
     1= How to reboot a physical server and guests =
     2
     3On occasion we need to reboot a physical server and all of it's guests (often due to a kernel upgrade).  This is an intensive process and can take a long time as many servers need to run fsck on reboot which demands intensive disk activity.  This page documents the currently recommended process for such reboots.
     4
     5== Make sure all guests on a host are updated ==
     6 * run package updates
     7{{{
     8apt-get update
     9apt-get -s dist-upgrade
     10}}}
     11  * if the server needs upgrades
     12{{{
     13apt-get dist-upgrade
     14}}}
     15
     16== Check available disk space ==
     17 * Make sure there is available space on the logical volumes, and take appropriate steps if not, see [[extend-disk-on-kvm-guest]]
     18  * if you added disk space from the host, reboot the guest with
     19{{{
     20shutdown -h now
     21}}}
     22
     23== Determine if the guest will fsck on reboot ==
     24 * On kvm guests or vserver hosts check when the next fsck is scheduled for all logical volumes with:
     25{{{
     26for i in $(ls /dev/mapper/vg_* | grep -v swap); do tune2fs -l $i | grep Next; done
     27}}}
     28  * '''e.g.'''
     29{{{
     300 malcolm:~# for i in $(ls /dev/mapper/vg_* | grep -v swap); do tune2fs -l $i | grep Next; done
     31Next check after:         Fri Oct 11 12:12:47 2013
     32Next check after:         Fri Oct 11 12:12:28 2013
     33Next check after:         Thu Aug 29 23:16:36 2013
     34Next check after:         Fri Oct 11 13:07:33 2013
     35Next check after:         Fri Oct 11 13:08:17 2013
     36Next check after:         Fri Oct 11 13:08:40 2013
     370 malcolm:~#
     38}}}
     39 * If a guest will fsck on reboot (i.e. the date from the above is earlier than the current date).  Reboot a kvm guest from root@GUEST with.  You can watch reboot progress with `ssh -t guest@host screen -x`
     40{{{
     41shutdown -r now
     42}}}
     43
     44'''Do this for all guests on the host.'''
     45
     46== Take down the host's guest ==
     47'''FIXME: Add better information for vservers'''
     48 * From 'root@host' check running services:
     49{{{
     50cd /etc/service
     51for x in *; do sv status $x; done
     52}}}
     53 * Take down each guest's service:
     54{{{
     55sv down GUESTNAME
     56}}}
     57  * Make sure the guest has gone down, this may take a few seconds.
     58   * If the guest has not gone down in a short time, you may need to manually restart from `root@guest` with:
     59{{{
     60shutdown -h now
     61}}}
     62 * Check to make sure all guests are down, repeat the status command above.  You should see a line that starts with `down: GUESTNAME` for all guests.
     63
     64== Reboot the host ==
     65 * Assuming all the guests are down, you should be able to restart the server.
     66 * Get access to the serial console
     67  * Telehouse use [[telehouse_serial_access]]
     68  * XO use [[xo_serial_access]]
     69 * Shut down the system from `root@host` with
     70{{{
     71shutdown -r now
     72}}}
     73 * Watch the reboot process from the serial console and enter the encrypted password when requested (accessed via keyringer)