blob: 1d4d4144dfe8f357fab5591e4192997fc0933bd3 [file] [log] [blame]
Dean Troyer8c032d12013-09-23 13:53:13 -05001# lib/nova_plugins/hypervisor-baremetal
2# Configure the baremetal hypervisor
3
4# Enable with:
5# VIRT_DRIVER=baremetal
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
18MY_XTRACE=$(set +o | grep xtrace)
19set +o xtrace
20
21
22# Defaults
23# --------
24
25NETWORK_MANAGER=${NETWORK_MANAGER:-FlatManager}
26PUBLIC_INTERFACE_DEFAULT=eth0
27FLAT_INTERFACE=${FLAT_INTERFACE:-eth0}
28FLAT_NETWORK_BRIDGE_DEFAULT=br100
29STUB_NETWORK=${STUB_NETWORK:-False}
30
31
32# Entry Points
33# ------------
34
35# clean_nova_hypervisor - Clean up an installation
Ian Wienandaee18c72014-02-21 15:35:08 +110036function cleanup_nova_hypervisor {
Dean Troyer8c032d12013-09-23 13:53:13 -050037 # This function intentionally left blank
38 :
39}
40
41# configure_nova_hypervisor - Set config files, create data dirs, etc
Ian Wienandaee18c72014-02-21 15:35:08 +110042function configure_nova_hypervisor {
Dean Troyer8c032d12013-09-23 13:53:13 -050043 configure_baremetal_nova_dirs
44
45 iniset $NOVA_CONF baremetal sql_connection `database_connection_url nova_bm`
46 LIBVIRT_FIREWALL_DRIVER=${LIBVIRT_FIREWALL_DRIVER:-"nova.virt.firewall.NoopFirewallDriver"}
47 iniset $NOVA_CONF DEFAULT compute_driver nova.virt.baremetal.driver.BareMetalDriver
48 iniset $NOVA_CONF DEFAULT firewall_driver $LIBVIRT_FIREWALL_DRIVER
49 iniset $NOVA_CONF DEFAULT scheduler_host_manager nova.scheduler.baremetal_host_manager.BaremetalHostManager
50 iniset $NOVA_CONF DEFAULT ram_allocation_ratio 1.0
51 iniset $NOVA_CONF DEFAULT reserved_host_memory_mb 0
Gary Kotton51c681d2014-04-22 01:40:56 -070052 iniset $NOVA_CONF baremetal flavor_extra_specs cpu_arch:$BM_CPU_ARCH
Dean Troyer8c032d12013-09-23 13:53:13 -050053 iniset $NOVA_CONF baremetal driver $BM_DRIVER
54 iniset $NOVA_CONF baremetal power_manager $BM_POWER_MANAGER
55 iniset $NOVA_CONF baremetal tftp_root /tftpboot
56 if [[ "$BM_DNSMASQ_FROM_NOVA_NETWORK" = "True" ]]; then
57 BM_DNSMASQ_CONF=$NOVA_CONF_DIR/dnsmasq-for-baremetal-from-nova-network.conf
58 sudo cp "$FILES/dnsmasq-for-baremetal-from-nova-network.conf" "$BM_DNSMASQ_CONF"
59 iniset $NOVA_CONF DEFAULT dnsmasq_config_file "$BM_DNSMASQ_CONF"
60 fi
61
62 # Define extra baremetal nova conf flags by defining the array ``EXTRA_BAREMETAL_OPTS``.
63 for I in "${EXTRA_BAREMETAL_OPTS[@]}"; do
Sean Dague101b4242013-10-22 08:47:11 -040064 # Attempt to convert flags to options
65 iniset $NOVA_CONF baremetal ${I/=/ }
Dean Troyer8c032d12013-09-23 13:53:13 -050066 done
67}
68
69# install_nova_hypervisor() - Install external components
Ian Wienandaee18c72014-02-21 15:35:08 +110070function install_nova_hypervisor {
Dean Troyer8c032d12013-09-23 13:53:13 -050071 # This function intentionally left blank
72 :
73}
74
75# start_nova_hypervisor - Start any required external services
Ian Wienandaee18c72014-02-21 15:35:08 +110076function start_nova_hypervisor {
Dean Troyer8c032d12013-09-23 13:53:13 -050077 # This function intentionally left blank
78 :
79}
80
81# stop_nova_hypervisor - Stop any external services
Ian Wienandaee18c72014-02-21 15:35:08 +110082function stop_nova_hypervisor {
Dean Troyer8c032d12013-09-23 13:53:13 -050083 # This function intentionally left blank
84 :
85}
86
87
88# Restore xtrace
89$MY_XTRACE
90
91# Local variables:
92# mode: shell-script
93# End: