Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 0a40866c53
Fetching contributors…

Cannot retrieve contributors at this time

file 40 lines (33 sloc) 1.087 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
#!/bin/sh
#
# Copyright (c) Citrix Systems 2008. All rights reserved.
#

# Runs on the George master when performing a rolling upgrade from Orlando

set -e

. @INVENTORY@
XE="@BINDIR@/xe"

# Clean all unreferenced patches out of the db now that the upgrade is complete.
# When upgrading to 5.0, this should clean out all 4.1 patches at the end.
function clean_patches {
    IFS=,
    for pool_patch in $(xe patch-list --minimal params=uuid hosts=) ; do
        xe patch-destroy uuid=${pool_patch}
    done
}

case "$1" in
  start)
    
  ;;
  stop)
    for i in $($XE sr-list other-config:xenserver_tools_sr=true params=uuid --minimal | sed 's/,/ /g'); do
      echo Renaming $i
      $XE sr-param-set uuid=$i name-label="XenServer Tools" name-description="XenServer Tools ISOs"
      echo Forgetting all missing VDIs
      # Note any suspended guest using one of these VDIs will be confused
      for j in $($XE vdi-list sr-uuid=$i missing=true params=uuid --minimal | sed 's/,/ /g'); do
$XE vdi-forget uuid=$j
      done
    done

    # Clean up patches
    clean_patches
  ;;
esac
Something went wrong with that request. Please try again.