~james-page/charms/precise/nova-cloud-controller/ha-support

« back to all changes in this revision

Viewing changes to hooks/lib/nova/nova-common

  • Committer: James Page
  • Date: 2013-01-18 12:22:44 UTC
  • mfrom: (51.2.1 nova-cloud-controller)
  • Revision ID: james.page@canonical.com-20130118122244-auu33jf4991mmmgm
Merged updates from adam_g for live migration and grizzly support.

Updated quantum integration to configure pool for floating IP addresses
for use with nova floating-* and pass quantum host and port to
quantum-network-service for use in nova-api-metadata proxy services.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
 
33
33
configure_volume_service() {
34
34
  local svc="$1"
 
35
  local cur_vers="$(get_os_codename_package "nova-common")"
35
36
  case "$svc" in
36
 
    "cinder") set_or_update "volume_api_class" "nova.volume.cinder.API" ;;
37
 
    "nova-volume") set_or_update "volume_api_class" "nova.volume.api.API" ;;
 
37
    "cinder")
 
38
      set_or_update "volume_api_class" "nova.volume.cinder.API" ;;
 
39
    "nova-volume")
 
40
      # nova-volume only supported before grizzly.
 
41
      [[ "$cur_vers" == "essex" ]] || [[ "$cur_vers" == "folsom" ]] &&
 
42
        set_or_update "volume_api_class" "nova.volume.api.API"
 
43
      ;;
38
44
    *) juju-log "$CHARM ERROR - configure_volume_service: Invalid service $svc"
39
45
       return 1 ;;
40
46
  esac
49
55
      ;;
50
56
    "FlatDHCPManager")
51
57
      set_or_update "network_manager" "nova.network.manager.FlatDHCPManager"
 
58
 
 
59
      if [[ "$CHARM" == "nova-compute" ]] ; then
 
60
        local flat_interface=$(config-get flat-interface)
 
61
        local ec2_host=$(relation-get ec2_host)
 
62
        set_or_update flat_inteface "$flat_interface"
 
63
        set_or_update ec2_dmz_host "$ec2_host"
 
64
 
 
65
        # Ensure flat_interface has link.
 
66
        if ip link show $flat_interface >/dev/null 2>&1 ; then
 
67
          ip link set $flat_interface up
 
68
        fi
 
69
 
 
70
        # work around (LP: #1035172)
 
71
        if [[ -e /dev/vhost-net ]] ; then
 
72
          iptables -A POSTROUTING -t mangle -p udp --dport 68 -j CHECKSUM \
 
73
            --checksum-fill
 
74
        fi
 
75
      fi
 
76
 
52
77
      ;;
53
78
    "Quantum")
54
79
      local local_ip=$(get_ip `unit-get private-address`)