blob: 22d16a667b731e8ac6b5261134978ae822b89193 [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
Dean Troyer8c032d12013-09-23 13:53:13 -050061}
62
63# install_nova_hypervisor() - Install external components
Ian Wienandaee18c72014-02-21 15:35:08 +110064function install_nova_hypervisor {
Dean Troyer8c032d12013-09-23 13:53:13 -050065 # This function intentionally left blank
66 :
67}
68
69# start_nova_hypervisor - Start any required external services
Ian Wienandaee18c72014-02-21 15:35:08 +110070function start_nova_hypervisor {
Dean Troyer8c032d12013-09-23 13:53:13 -050071 # This function intentionally left blank
72 :
73}
74
75# stop_nova_hypervisor - Stop any external services
Ian Wienandaee18c72014-02-21 15:35:08 +110076function stop_nova_hypervisor {
Dean Troyer8c032d12013-09-23 13:53:13 -050077 # This function intentionally left blank
78 :
79}
80
81
82# Restore xtrace
83$MY_XTRACE
84
85# Local variables:
86# mode: shell-script
87# End: