Skip to content

Commit 03954d6

Browse files
committed
CA-221976: Only set up PVS rules if daemon has been configured for the VM
Signed-off-by: Rob Hoes <[email protected]>
1 parent 258ed6e commit 03954d6

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

scripts/setup-pvs-proxy-rules

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,25 @@ handle_xs_error()
3838

3939
logger -t "$LOG_TAG" "Called as $0 $*"
4040

41+
path="${PRIVATE_PATH}/pvs-site"
42+
PVS_SITE=$($XSREAD "$path")
43+
if [ $? -ne 0 ] || [ -z "$PVS_SITE" ]; then
44+
handle_xs_error "$path"
45+
fi
46+
47+
path="${PRIVATE_PATH}/vif-uuid"
48+
VIF=$($XSREAD "$path")
49+
if [ $? -ne 0 ] || [ -z "$VIF" ]; then
50+
handle_xs_error "$path"
51+
fi
52+
53+
# Only continue if the proxy state is "started".
54+
path="/xapi/pvs-proxy/$PVS_SITE/$VIF/state"
55+
PVS_PROXY_STATE=$($XSREAD "$path")
56+
if [ "$PVS_PROXY_STATE" != "started" ]; then
57+
handle_error "PVS proxy daemon not configured for this proxy - not installing OVS rules."
58+
fi
59+
4160
path="${PRIVATE_PATH}/pvs-interface"
4261
PVS_PROXY_INTERFACE=$($XSREAD "$path")
4362
if [ $? -ne 0 ] || [ -z "$PVS_PROXY_INTERFACE" ]; then

0 commit comments

Comments
 (0)