~openstack-charmers/charms/precise/nova-compute/ha-support

« back to all changes in this revision

Viewing changes to hooks/lib/nova/grizzly

  • Committer: James Page
  • Date: 2013-05-22 08:39:57 UTC
  • Revision ID: james.page@canonical.com-20130522083957-snmwortqfbgvtrpm
Add grizzly post_upgrade hook

Show diffs side-by-side

added added

removed removed

Lines of Context:
76
76
nova_post_upgrade() {
77
77
  # Post-upgrade helper.  Caller should pass the version of OpenStack we are
78
78
  # upgrading from.
79
 
  juju-log "$CHARM: Running post-upgrade hook: $upgrade_from -> folsom."
80
 
  # nothing to do here yet.
 
79
  local upgrade_from="$1"
 
80
  juju-log "$CHARM: Running post-upgrade hook: $upgrade_from -> grizzly."
 
81
  # We only support folsom -> grizzly, currently.
 
82
  [[ "$upgrade_from" != "folsom" ]] &&
 
83
    error_out "Unsupported upgrade: $upgrade_from -> grizzly"
 
84
 
 
85
  # This may be dangerous, if we are upgrading a number of units at once
 
86
  # and they all begin the same migration concurrently.  Migrate only from
 
87
  # the cloud controller(s).
 
88
  if [[ "$CHARM" == "nova-cloud-controller" ]] ; then
 
89
    juju-log "$CHARM: Migrating nova database."
 
90
    /usr/bin/nova-manage db sync
 
91
 
 
92
    # Trigger a service restart on all other nova nodes.
 
93
    trigger_remote_service_restarts
 
94
  fi
 
95
 
 
96
  juju-log "$CHARM: Post-upgrade hook complete: $upgrade_from -> folsom."
81
97
}