Sean Dague | e263c82 | 2014-12-05 14:25:28 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
Dean Troyer | 8c032d1 | 2013-09-23 13:53:13 -0500 | [diff] [blame] | 3 | # lib/nova_plugins/hypervisor-openvz |
| 4 | # Configure the openvz hypervisor |
| 5 | |
| 6 | # Enable with: |
| 7 | # VIRT_DRIVER=openvz |
| 8 | |
| 9 | # Dependencies: |
| 10 | # ``functions`` file |
| 11 | # ``nova`` configuration |
| 12 | |
| 13 | # install_nova_hypervisor - install any external requirements |
| 14 | # configure_nova_hypervisor - make configuration changes, including those to other services |
| 15 | # start_nova_hypervisor - start any external services |
| 16 | # stop_nova_hypervisor - stop any external services |
| 17 | # cleanup_nova_hypervisor - remove transient data and cache |
| 18 | |
| 19 | # Save trace setting |
Ian Wienand | 523f488 | 2015-10-13 11:03:03 +1100 | [diff] [blame^] | 20 | _XTRACE_OPENVZ=$(set +o | grep xtrace) |
Dean Troyer | 8c032d1 | 2013-09-23 13:53:13 -0500 | [diff] [blame] | 21 | set +o xtrace |
| 22 | |
| 23 | |
| 24 | # Defaults |
| 25 | # -------- |
| 26 | |
| 27 | |
| 28 | # Entry Points |
| 29 | # ------------ |
| 30 | |
| 31 | # clean_nova_hypervisor - Clean up an installation |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 32 | function cleanup_nova_hypervisor { |
Dean Troyer | 8c032d1 | 2013-09-23 13:53:13 -0500 | [diff] [blame] | 33 | # This function intentionally left blank |
| 34 | : |
| 35 | } |
| 36 | |
| 37 | # configure_nova_hypervisor - Set config files, create data dirs, etc |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 38 | function configure_nova_hypervisor { |
Dean Troyer | 8c032d1 | 2013-09-23 13:53:13 -0500 | [diff] [blame] | 39 | iniset $NOVA_CONF DEFAULT compute_driver "openvz.OpenVzDriver" |
| 40 | iniset $NOVA_CONF DEFAULT connection_type "openvz" |
| 41 | LIBVIRT_FIREWALL_DRIVER=${LIBVIRT_FIREWALL_DRIVER:-"nova.virt.libvirt.firewall.IptablesFirewallDriver"} |
| 42 | iniset $NOVA_CONF DEFAULT firewall_driver "$LIBVIRT_FIREWALL_DRIVER" |
| 43 | } |
| 44 | |
| 45 | # install_nova_hypervisor() - Install external components |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 46 | function install_nova_hypervisor { |
Dean Troyer | 8c032d1 | 2013-09-23 13:53:13 -0500 | [diff] [blame] | 47 | # This function intentionally left blank |
| 48 | : |
| 49 | } |
| 50 | |
| 51 | # start_nova_hypervisor - Start any required external services |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 52 | function start_nova_hypervisor { |
Dean Troyer | 8c032d1 | 2013-09-23 13:53:13 -0500 | [diff] [blame] | 53 | # This function intentionally left blank |
| 54 | : |
| 55 | } |
| 56 | |
| 57 | # stop_nova_hypervisor - Stop any external services |
Ian Wienand | aee18c7 | 2014-02-21 15:35:08 +1100 | [diff] [blame] | 58 | function stop_nova_hypervisor { |
Dean Troyer | 8c032d1 | 2013-09-23 13:53:13 -0500 | [diff] [blame] | 59 | # This function intentionally left blank |
| 60 | : |
| 61 | } |
| 62 | |
| 63 | |
| 64 | # Restore xtrace |
Ian Wienand | 523f488 | 2015-10-13 11:03:03 +1100 | [diff] [blame^] | 65 | $_XTRACE_OPENVZ |
Dean Troyer | 8c032d1 | 2013-09-23 13:53:13 -0500 | [diff] [blame] | 66 | |
| 67 | # Local variables: |
| 68 | # mode: shell-script |
| 69 | # End: |