From e240dd501e477d4b2f1d7fcda898e47931a6ba37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Harald=20Jens=C3=A5s?= Date: Mon, 18 Feb 2019 12:28:42 +0100 Subject: [PATCH] Devstack - run vbmc as sudo On CentOS 7 following the documentatition to set up ironic in devstack I keep getting permission error because for some reason the $HOME is root's home. [Errno 13] Permission denied: '/root/.vbmc' The permission issue causes various error's when trying to re-stack and unstack. Also, kill all vbmc processes after cleanup-nodes. Change-Id: I92683dc9345825671310e199d0a6e36bdc462ed0 --- devstack/lib/ironic | 2 ++ devstack/tools/ironic/scripts/cleanup-node.sh | 2 +- devstack/tools/ironic/scripts/create-node.sh | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/devstack/lib/ironic b/devstack/lib/ironic index 6c3ed09aac..899559d828 100644 --- a/devstack/lib/ironic +++ b/devstack/lib/ironic @@ -2438,6 +2438,8 @@ function cleanup_baremetal_basic_ops { done done + sudo killall vbmc || true + sudo ovs-vsctl --if-exists del-br $IRONIC_VM_NETWORK_BRIDGE sudo rm -rf /etc/xinetd.d/tftp /etc/init/tftpd-hpa.override diff --git a/devstack/tools/ironic/scripts/cleanup-node.sh b/devstack/tools/ironic/scripts/cleanup-node.sh index 466b7059b8..e594c282be 100755 --- a/devstack/tools/ironic/scripts/cleanup-node.sh +++ b/devstack/tools/ironic/scripts/cleanup-node.sh @@ -23,7 +23,7 @@ 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 + sudo vbmc list | grep -a $NAME && sudo vbmc delete $NAME fi if virsh pool-list | grep -q $LIBVIRT_STORAGE_POOL ; then diff --git a/devstack/tools/ironic/scripts/create-node.sh b/devstack/tools/ironic/scripts/create-node.sh index 908aadca53..a264522824 100755 --- a/devstack/tools/ironic/scripts/create-node.sh +++ b/devstack/tools/ironic/scripts/create-node.sh @@ -131,8 +131,8 @@ if ! virsh list --all | grep -q $NAME; then # Createa Virtual BMC for the node if IPMI is used if [[ $(type -P vbmc) != "" ]]; then - vbmc add $NAME --port $VBMC_PORT - vbmc start $NAME + sudo vbmc add $NAME --port $VBMC_PORT + sudo vbmc start $NAME fi fi