Merge "Improve VirtualBMC use in Devstack"

This commit is contained in:
Zuul 2019-05-06 16:33:25 +00:00 committed by Gerrit Code Review
commit 00622ae23f
3 changed files with 10 additions and 11 deletions

View File

@ -1769,6 +1769,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))
@ -2560,6 +2565,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