Merge "Add systemd unit for vbmcd in devstack"
This commit is contained in:
commit
d4d1a0132a
@ -336,6 +336,7 @@ IRONIC_IS_HARDWARE=$(trueorfalse False IRONIC_IS_HARDWARE)
|
|||||||
IRONIC_VBMC_PORT_RANGE_START=${IRONIC_VBMC_PORT_RANGE_START:-6230}
|
IRONIC_VBMC_PORT_RANGE_START=${IRONIC_VBMC_PORT_RANGE_START:-6230}
|
||||||
IRONIC_VBMC_CONFIG_FILE=${IRONIC_VBMC_CONFIG_FILE:-$HOME/.vbmc/virtualbmc.conf}
|
IRONIC_VBMC_CONFIG_FILE=${IRONIC_VBMC_CONFIG_FILE:-$HOME/.vbmc/virtualbmc.conf}
|
||||||
IRONIC_VBMC_LOGFILE=${IRONIC_VBMC_LOGFILE:-$IRONIC_VM_LOG_DIR/virtualbmc.log}
|
IRONIC_VBMC_LOGFILE=${IRONIC_VBMC_LOGFILE:-$IRONIC_VM_LOG_DIR/virtualbmc.log}
|
||||||
|
IRONIC_VBMC_SYSTEMD_SERVICE=devstack@virtualbmc.service
|
||||||
|
|
||||||
# Virtual PDU configs
|
# Virtual PDU configs
|
||||||
IRONIC_VPDU_CONFIG_FILE=${IRONIC_VPDU_CONFIG_FILE:-$HOME/.vpdu/virtualpdu.conf}
|
IRONIC_VPDU_CONFIG_FILE=${IRONIC_VPDU_CONFIG_FILE:-$HOME/.vpdu/virtualpdu.conf}
|
||||||
@ -723,6 +724,25 @@ function setup_syslinux_modules {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function start_virtualbmc {
|
||||||
|
$SYSTEMCTL start $IRONIC_VBMC_SYSTEMD_SERVICE
|
||||||
|
}
|
||||||
|
|
||||||
|
function stop_virtualbmc {
|
||||||
|
$SYSTEMCTL stop $IRONIC_VBMC_SYSTEMD_SERVICE
|
||||||
|
}
|
||||||
|
|
||||||
|
function cleanup_virtualbmc {
|
||||||
|
stop_virtualbmc
|
||||||
|
|
||||||
|
$SYSTEMCTL disable $IRONIC_VBMC_SYSTEMD_SERVICE
|
||||||
|
|
||||||
|
local unitfile="$SYSTEMD_DIR/$IRONIC_VBMC_SYSTEMD_SERVICE"
|
||||||
|
sudo rm -f $unitfile
|
||||||
|
|
||||||
|
$SYSTEMCTL daemon-reload
|
||||||
|
}
|
||||||
|
|
||||||
function setup_virtualbmc {
|
function setup_virtualbmc {
|
||||||
# Install pyghmi from source, if requested, otherwise it will be
|
# Install pyghmi from source, if requested, otherwise it will be
|
||||||
# downloaded as part of the virtualbmc installation
|
# downloaded as part of the virtualbmc installation
|
||||||
@ -747,8 +767,18 @@ function setup_virtualbmc {
|
|||||||
|
|
||||||
iniset $IRONIC_VBMC_CONFIG_FILE log debug True
|
iniset $IRONIC_VBMC_CONFIG_FILE log debug True
|
||||||
iniset $IRONIC_VBMC_CONFIG_FILE log logfile $IRONIC_VBMC_LOGFILE
|
iniset $IRONIC_VBMC_CONFIG_FILE log logfile $IRONIC_VBMC_LOGFILE
|
||||||
}
|
|
||||||
|
|
||||||
|
local cmd
|
||||||
|
|
||||||
|
cmd=$(which vbmcd)
|
||||||
|
cmd+=" --foreground"
|
||||||
|
|
||||||
|
write_user_unit_file $IRONIC_VBMC_SYSTEMD_SERVICE "$cmd" "" "root"
|
||||||
|
|
||||||
|
$SYSTEMCTL enable $IRONIC_VBMC_SYSTEMD_SERVICE
|
||||||
|
|
||||||
|
start_virtualbmc
|
||||||
|
}
|
||||||
|
|
||||||
function setup_virtualpdu {
|
function setup_virtualpdu {
|
||||||
if use_library_from_git "virtualpdu"; then
|
if use_library_from_git "virtualpdu"; then
|
||||||
@ -2457,7 +2487,7 @@ function cleanup_baremetal_basic_ops {
|
|||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
||||||
sudo killall vbmc || true
|
cleanup_virtualbmc
|
||||||
|
|
||||||
sudo ovs-vsctl --if-exists del-br $IRONIC_VM_NETWORK_BRIDGE
|
sudo ovs-vsctl --if-exists del-br $IRONIC_VM_NETWORK_BRIDGE
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ virsh list --inactive | grep -q $NAME && virsh undefine $NAME --nvram
|
|||||||
|
|
||||||
# Delete the Virtual BMC
|
# Delete the Virtual BMC
|
||||||
if [[ $(type -P vbmc) != "" ]]; then
|
if [[ $(type -P vbmc) != "" ]]; then
|
||||||
sudo vbmc list | grep -a $NAME && sudo vbmc delete $NAME
|
vbmc list | grep -a $NAME && vbmc delete $NAME
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if virsh pool-list | grep -q $LIBVIRT_STORAGE_POOL ; then
|
if virsh pool-list | grep -q $LIBVIRT_STORAGE_POOL ; then
|
||||||
|
@ -129,10 +129,10 @@ if ! virsh list --all | grep -q $NAME; then
|
|||||||
--disk-format $DISK_FORMAT $VM_LOGGING --engine $ENGINE $UEFI_OPTS $vm_opts \
|
--disk-format $DISK_FORMAT $VM_LOGGING --engine $ENGINE $UEFI_OPTS $vm_opts \
|
||||||
--interface-count $INTERFACE_COUNT $MAC_ADDRESS >&2
|
--interface-count $INTERFACE_COUNT $MAC_ADDRESS >&2
|
||||||
|
|
||||||
# Createa Virtual BMC for the node if IPMI is used
|
# Create Virtual BMC for the node if IPMI is used
|
||||||
if [[ $(type -P vbmc) != "" ]]; then
|
if [[ $(type -P vbmc) != "" ]]; then
|
||||||
sudo vbmc add $NAME --port $VBMC_PORT
|
vbmc add $NAME --port $VBMC_PORT
|
||||||
sudo vbmc start $NAME
|
vbmc start $NAME
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user