Dean Troyer | 9a532b8 | 2013-09-23 13:44:38 -0500 | [diff] [blame] | 1 | # lib/nova_plugins/hypervisor-xenserver |
| 2 | # Configure the XenServer hypervisor |
| 3 | |
| 4 | # Enable with: |
| 5 | # VIRT_DRIVER=xenserver |
| 6 | |
| 7 | # Dependencies: |
| 8 | # ``functions`` file |
| 9 | # ``nova`` configuration |
| 10 | |
| 11 | # install_nova_hypervisor - install any external requirements |
| 12 | # configure_nova_hypervisor - make configuration changes, including those to other services |
| 13 | # start_nova_hypervisor - start any external services |
| 14 | # stop_nova_hypervisor - stop any external services |
| 15 | # cleanup_nova_hypervisor - remove transient data and cache |
| 16 | |
| 17 | # Save trace setting |
| 18 | MY_XTRACE=$(set +o | grep xtrace) |
| 19 | set +o xtrace |
| 20 | |
| 21 | |
| 22 | # Defaults |
| 23 | # -------- |
| 24 | |
| 25 | PUBLIC_INTERFACE_DEFAULT=eth2 |
| 26 | GUEST_INTERFACE_DEFAULT=eth1 |
| 27 | # Allow ``build_domU.sh`` to specify the flat network bridge via kernel args |
| 28 | FLAT_NETWORK_BRIDGE_DEFAULT=$(sed -e 's/.* flat_network_bridge=\([[:alnum:]]*\).*$/\1/g' /proc/cmdline) |
| 29 | if is_service_enabled neutron; then |
| 30 | XEN_INTEGRATION_BRIDGE=$(sed -e 's/.* xen_integration_bridge=\([[:alnum:]]*\).*$/\1/g' /proc/cmdline) |
| 31 | fi |
| 32 | |
| 33 | VNCSERVER_PROXYCLIENT_ADDRESS=${VNCSERVER_PROXYCLIENT_ADDRESS=169.254.0.1} |
| 34 | |
| 35 | |
| 36 | # Entry Points |
| 37 | # ------------ |
| 38 | |
| 39 | # clean_nova_hypervisor - Clean up an installation |
| 40 | function cleanup_nova_hypervisor() { |
| 41 | # This function intentionally left blank |
| 42 | : |
| 43 | } |
| 44 | |
| 45 | # configure_nova_hypervisor - Set config files, create data dirs, etc |
| 46 | function configure_nova_hypervisor() { |
| 47 | if [ -z "$XENAPI_CONNECTION_URL" ]; then |
| 48 | die $LINENO "XENAPI_CONNECTION_URL is not specified" |
| 49 | fi |
| 50 | read_password XENAPI_PASSWORD "ENTER A PASSWORD TO USE FOR XEN." |
| 51 | iniset $NOVA_CONF DEFAULT compute_driver "xenapi.XenAPIDriver" |
| 52 | iniset $NOVA_CONF DEFAULT xenapi_connection_url "$XENAPI_CONNECTION_URL" |
| 53 | iniset $NOVA_CONF DEFAULT xenapi_connection_username "$XENAPI_USER" |
| 54 | iniset $NOVA_CONF DEFAULT xenapi_connection_password "$XENAPI_PASSWORD" |
| 55 | iniset $NOVA_CONF DEFAULT flat_injected "False" |
| 56 | # Need to avoid crash due to new firewall support |
| 57 | XEN_FIREWALL_DRIVER=${XEN_FIREWALL_DRIVER:-"nova.virt.firewall.IptablesFirewallDriver"} |
| 58 | iniset $NOVA_CONF DEFAULT firewall_driver "$XEN_FIREWALL_DRIVER" |
| 59 | } |
| 60 | |
| 61 | # install_nova_hypervisor() - Install external components |
| 62 | function install_nova_hypervisor() { |
| 63 | # This function intentionally left blank |
| 64 | : |
| 65 | } |
| 66 | |
| 67 | # start_nova_hypervisor - Start any required external services |
| 68 | function start_nova_hypervisor() { |
| 69 | # This function intentionally left blank |
| 70 | : |
| 71 | } |
| 72 | |
| 73 | # stop_nova_hypervisor - Stop any external services |
| 74 | function stop_nova_hypervisor() { |
| 75 | # This function intentionally left blank |
| 76 | : |
| 77 | } |
| 78 | |
| 79 | |
| 80 | # Restore xtrace |
| 81 | $MY_XTRACE |
| 82 | |
| 83 | # Local variables: |
| 84 | # mode: shell-script |
| 85 | # End: |