Improve VirtualBMC use in Devstack

This patch brings two somewhat related changes:

1. Older versions of VirtualBMC worked without any server keeping
   state on the filesystem. The contemporary version is build around
   client-server model. To preserve backward compatibility, the
   `vbmc` client would invoke `vbmcd` behind the scenes if the daemon
   is not running.

   This change inhibits this automatic `vbmcd` start behaviour because
   devstack invokes `vbmcd` explicitly through systemd.

2. This patch makes Devstack messing with VirtualBMC only if it is
   determined that IPMI deployment is required. Otherwise (e.g.
   Redfish deployment is planned) Devstack will not attempt to
   start/stop IPMI emulation.

Change-Id: Id9a2ed71a997fb13523a77563d6e941904675f97
This commit is contained in:
Ilya Etingof 2019-03-28 19:25:28 +01:00
parent 380519c07f
commit 01b0be9db2
3 changed files with 10 additions and 11 deletions

View File

@ -1765,6 +1765,11 @@ function create_bridge_and_vms {
-i $IRONIC_VM_INTERFACE_COUNT -f $IRONIC_VM_SPECS_DISK_FORMAT -M $PUBLIC_BRIDGE_MTU $log_arg >> $IRONIC_VM_MACS_CSV_FILE
SUBSHELL
if is_deployed_by_ipmi; then
vbmc --no-daemon add $vm_name --port $vbmc_port
vbmc --no-daemon start $vm_name
fi
echo " ${bridge_mac} $IRONIC_VM_NETWORK_BRIDGE" >> $IRONIC_VM_MACS_CSV_FILE
vbmc_port=$((vbmc_port+1))
@ -2556,6 +2561,11 @@ function cleanup_baremetal_basic_ops {
local vm_name
for vm_name in $(_ironic_bm_vm_names); do
# Delete the Virtual BMCs
if is_deployed_by_ipmi; then
vbmc --no-daemon list | grep -a $NAME && vbmc --no-daemon delete $NAME || /bin/true
fi
# pick up the $LIBVIRT_GROUP we have possibly joint
newgrp $LIBVIRT_GROUP <<SUBSHELL
$IRONIC_SCRIPTS_DIR/cleanup-node.sh $vm_name

View File

@ -21,11 +21,6 @@ VOL_NAME="$NAME.qcow2"
virsh list | grep -q $NAME && virsh destroy $NAME
virsh list --inactive | grep -q $NAME && virsh undefine $NAME --nvram
# Delete the Virtual BMC
if [[ $(type -P vbmc) != "" ]]; then
vbmc list | grep -a $NAME && vbmc delete $NAME
fi
if virsh pool-list | grep -q $LIBVIRT_STORAGE_POOL ; then
virsh vol-list $LIBVIRT_STORAGE_POOL | grep -q $VOL_NAME &&
virsh vol-delete $VOL_NAME --pool $LIBVIRT_STORAGE_POOL

View File

@ -128,12 +128,6 @@ if ! virsh list --all | grep -q $NAME; then
--arch $ARCH --cpus $CPU --memory $MEM --libvirt-nic-driver $LIBVIRT_NIC_DRIVER \
--disk-format $DISK_FORMAT $VM_LOGGING --engine $ENGINE $UEFI_OPTS $vm_opts \
--interface-count $INTERFACE_COUNT $MAC_ADDRESS >&2
# Create Virtual BMC for the node if IPMI is used
if [[ $(type -P vbmc) != "" ]]; then
vbmc add $NAME --port $VBMC_PORT
vbmc start $NAME
fi
fi
# echo mac in format mac1,ovs-node-0i1;mac2,ovs-node-0i2;...;macN,ovs-node0iN