| Alexander Gordeev | 06fb29c | 2014-01-31 18:02:07 +0400 | [diff] [blame] | 1 | # lib/nova_plugins/hypervisor-ironic | 
|  | 2 | # Configure the ironic hypervisor | 
|  | 3 |  | 
|  | 4 | # Enable with: | 
|  | 5 | # VIRT_DRIVER=ironic | 
|  | 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 |  | 
| Adam Gandelman | ea86174 | 2014-03-17 16:23:01 -0700 | [diff] [blame] | 21 | source $TOP_DIR/lib/nova_plugins/functions-libvirt | 
| Alexander Gordeev | 06fb29c | 2014-01-31 18:02:07 +0400 | [diff] [blame] | 22 |  | 
|  | 23 | # Defaults | 
|  | 24 | # -------- | 
|  | 25 |  | 
|  | 26 | # Entry Points | 
|  | 27 | # ------------ | 
|  | 28 |  | 
|  | 29 | # clean_nova_hypervisor - Clean up an installation | 
|  | 30 | function cleanup_nova_hypervisor { | 
|  | 31 | # This function intentionally left blank | 
|  | 32 | : | 
|  | 33 | } | 
|  | 34 |  | 
|  | 35 | # configure_nova_hypervisor - Set config files, create data dirs, etc | 
|  | 36 | function configure_nova_hypervisor { | 
| Adam Gandelman | ea86174 | 2014-03-17 16:23:01 -0700 | [diff] [blame] | 37 | configure_libvirt | 
| Alexander Gordeev | 06fb29c | 2014-01-31 18:02:07 +0400 | [diff] [blame] | 38 | LIBVIRT_FIREWALL_DRIVER=${LIBVIRT_FIREWALL_DRIVER:-"nova.virt.firewall.NoopFirewallDriver"} | 
| Davide Guerri | 08448e3 | 2014-03-21 18:14:18 +0000 | [diff] [blame] | 39 |  | 
| Adam Gandelman | 1bb9ef6 | 2014-03-31 11:41:54 -0700 | [diff] [blame] | 40 | # NOTE(adam_g): The ironic compute driver currently lives in the ironic | 
|  | 41 | # tree.  We purposely configure Nova to load it from there until it moves | 
|  | 42 | # back into Nova proper. | 
|  | 43 | iniset $NOVA_CONF DEFAULT compute_driver ironic.nova.virt.ironic.IronicDriver | 
| Alexander Gordeev | 06fb29c | 2014-01-31 18:02:07 +0400 | [diff] [blame] | 44 | iniset $NOVA_CONF DEFAULT firewall_driver $LIBVIRT_FIREWALL_DRIVER | 
|  | 45 | iniset $NOVA_CONF DEFAULT scheduler_host_manager ironic.nova.scheduler.ironic_host_manager.IronicHostManager | 
|  | 46 | iniset $NOVA_CONF DEFAULT ram_allocation_ratio 1.0 | 
|  | 47 | iniset $NOVA_CONF DEFAULT reserved_host_memory_mb 0 | 
|  | 48 | # ironic section | 
|  | 49 | iniset $NOVA_CONF ironic admin_username admin | 
|  | 50 | iniset $NOVA_CONF ironic admin_password $ADMIN_PASSWORD | 
| Jamie Lennox | 3561d7f | 2014-05-21 17:18:43 +1000 | [diff] [blame] | 51 | iniset $NOVA_CONF ironic admin_url $KEYSTONE_AUTH_URI/v2.0 | 
| Alexander Gordeev | 06fb29c | 2014-01-31 18:02:07 +0400 | [diff] [blame] | 52 | iniset $NOVA_CONF ironic admin_tenant_name demo | 
| Ruby Loo | 1117479 | 2014-03-26 17:19:36 +0000 | [diff] [blame] | 53 | iniset $NOVA_CONF ironic api_endpoint http://$SERVICE_HOST:6385/v1 | 
| Adam Gandelman | 1bb9ef6 | 2014-03-31 11:41:54 -0700 | [diff] [blame] | 54 | iniset $NOVA_CONF ironic sql_connection `database_connection_url nova_bm` | 
| Alexander Gordeev | 06fb29c | 2014-01-31 18:02:07 +0400 | [diff] [blame] | 55 | } | 
|  | 56 |  | 
|  | 57 | # install_nova_hypervisor() - Install external components | 
|  | 58 | function install_nova_hypervisor { | 
| Adam Gandelman | ea86174 | 2014-03-17 16:23:01 -0700 | [diff] [blame] | 59 | install_libvirt | 
| Alexander Gordeev | 06fb29c | 2014-01-31 18:02:07 +0400 | [diff] [blame] | 60 | } | 
|  | 61 |  | 
|  | 62 | # start_nova_hypervisor - Start any required external services | 
|  | 63 | function start_nova_hypervisor { | 
|  | 64 | # This function intentionally left blank | 
|  | 65 | : | 
|  | 66 | } | 
|  | 67 |  | 
|  | 68 | # stop_nova_hypervisor - Stop any external services | 
|  | 69 | function stop_nova_hypervisor { | 
|  | 70 | # This function intentionally left blank | 
|  | 71 | : | 
|  | 72 | } | 
|  | 73 |  | 
|  | 74 |  | 
|  | 75 | # Restore xtrace | 
|  | 76 | $MY_XTRACE | 
|  | 77 |  | 
|  | 78 | # Local variables: | 
|  | 79 | # mode: shell-script | 
|  | 80 | # End: |