blob: 9a39c798a87bf45e7d4b5526fac0332c9f2b57e7 [file] [log] [blame]
Sean Daguee263c822014-12-05 14:25:28 -05001#!/bin/bash
2#
Alexander Gordeev06fb29c2014-01-31 18:02:07 +04003# lib/nova_plugins/hypervisor-ironic
4# Configure the ironic hypervisor
5
6# Enable with:
7# VIRT_DRIVER=ironic
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 Wienand523f4882015-10-13 11:03:03 +110020_XTRACE_HYP_IRONIC=$(set +o | grep xtrace)
Alexander Gordeev06fb29c2014-01-31 18:02:07 +040021set +o xtrace
22
Adam Gandelmanea861742014-03-17 16:23:01 -070023source $TOP_DIR/lib/nova_plugins/functions-libvirt
Alexander Gordeev06fb29c2014-01-31 18:02:07 +040024
25# Defaults
26# --------
27
28# Entry Points
29# ------------
30
31# clean_nova_hypervisor - Clean up an installation
32function cleanup_nova_hypervisor {
33 # This function intentionally left blank
34 :
35}
36
37# configure_nova_hypervisor - Set config files, create data dirs, etc
38function configure_nova_hypervisor {
Vanou Ishii705e9cb2019-07-02 00:40:24 -040039 if ! is_ironic_hardware; then
40 configure_libvirt
41 fi
Davide Guerri08448e32014-03-21 18:14:18 +000042
vsaienkoe3a04dd2016-04-26 10:26:25 +030043 iniset $NOVA_CONF DEFAULT compute_driver ironic.IronicDriver
Sam Betts80149452017-08-03 12:41:36 +010044
Alexander Gordeev06fb29c2014-01-31 18:02:07 +040045 # ironic section
Clenimar Filemon57df1862016-06-30 17:30:26 -030046 iniset $NOVA_CONF ironic auth_type password
47 iniset $NOVA_CONF ironic username admin
48 iniset $NOVA_CONF ironic password $ADMIN_PASSWORD
Jens Harbott32c00892019-04-10 10:33:39 +000049 iniset $NOVA_CONF ironic auth_url $KEYSTONE_SERVICE_URI
Julia Kreger6af3cb92021-03-11 11:28:47 -080050 if is_ironic_enforce_scope; then
51 iniset $NOVA_CONF ironic system_scope all
52 else
53 iniset $NOVA_CONF ironic project_domain_id default
54 iniset $NOVA_CONF ironic project_name demo
55 fi
Jay Faulknere1297192023-09-10 16:24:38 -070056 if is_ironic_sharded; then
57 iniset $NOVA_CONF ironic shard $IRONIC_SHARD_1_NAME
58 fi
59
Clenimar Filemon57df1862016-06-30 17:30:26 -030060 iniset $NOVA_CONF ironic user_domain_id default
Erik Olof Gunnar Anderssona13474f2019-04-18 12:18:23 -070061 iniset $NOVA_CONF ironic region_name $REGION_NAME
Vasyl Saienko64039ef2018-01-23 12:06:57 +020062
Eric Friede273c042019-08-13 14:28:24 -050063 # These are used with crufty legacy ironicclient
Vasyl Saienko64039ef2018-01-23 12:06:57 +020064 iniset $NOVA_CONF ironic api_max_retries 300
65 iniset $NOVA_CONF ironic api_retry_interval 5
Eric Friede273c042019-08-13 14:28:24 -050066 # These are used with shiny new openstacksdk
67 iniset $NOVA_CONF ironic connect_retries 300
68 iniset $NOVA_CONF ironic connect_retry_delay 5
69 iniset $NOVA_CONF ironic status_code_retries 300
70 iniset $NOVA_CONF ironic status_code_retry_delay 5
Alexander Gordeev06fb29c2014-01-31 18:02:07 +040071}
72
73# install_nova_hypervisor() - Install external components
74function install_nova_hypervisor {
Adam Gandelmande77c472015-03-11 17:15:42 -070075 if is_ironic_hardware; then
Zhongyue Luo37026f52014-12-16 10:56:54 +080076 return
Adam Gandelman6d271482014-08-05 18:12:29 -070077 fi
Adam Gandelmanea861742014-03-17 16:23:01 -070078 install_libvirt
Alexander Gordeev06fb29c2014-01-31 18:02:07 +040079}
80
81# start_nova_hypervisor - Start any required external services
82function start_nova_hypervisor {
83 # This function intentionally left blank
84 :
85}
86
87# stop_nova_hypervisor - Stop any external services
88function stop_nova_hypervisor {
89 # This function intentionally left blank
90 :
91}
92
Alexander Gordeev06fb29c2014-01-31 18:02:07 +040093# Restore xtrace
Ian Wienand523f4882015-10-13 11:03:03 +110094$_XTRACE_HYP_IRONIC
Alexander Gordeev06fb29c2014-01-31 18:02:07 +040095
96# Local variables:
97# mode: shell-script
98# End: