Skip to content
This repository has been archived by the owner on Nov 9, 2020. It is now read-only.

Commit

Permalink
Turned off VMODL support in the VIB. (#975)
Browse files Browse the repository at this point in the history
Seince we do not use it yet and it does impact VSAN mgmt server restart,
turning it off for now to minimize unneccessary impact on other components.

* dropped code from VIB
* change Makefike to ignore tests and deploy for VMODL
* turned off VMODL unit tests
  • Loading branch information
Mark Sterin authored Feb 28, 2017
1 parent 8f677fa commit d45c2ec
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 9 deletions.
5 changes: 4 additions & 1 deletion esx_service/vmdk-opsd
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,10 @@ start() {

check_running_status
# brute force hack - restart vsanmgmtd to force it to read and server out VMODL py files
/etc/init.d/vsanmgmtd restart ; sleep 3 ;
# turned off until we support kill switch.
# see https://github.com/vmware/docker-volume-vsphere/pull/975 for details.

# /etc/init.d/vsanmgmtd restart ; sleep 3 ;
exit $?
}

Expand Down
26 changes: 19 additions & 7 deletions esx_service/vmodl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
#
# Basic makefile to validate and package python stuff
#
# Example:
# Example:
# ESX=10.132.15.22 make test # deploys to ESX, runs *_test.py files to validate the stuff
#
#

# SSH/SCP commands. Use 'DEBUG=echo make' to print info instead of copying files or running ssh
SSH := $(DEBUG) ssh -kTax -o StrictHostKeyChecking=no
Expand All @@ -28,11 +28,11 @@ PY2_COMMON = /lib/python2.7
TARGET2 := $(PY2_COMMON)/site-packages/pyMo/vim/vsan
TARGET3 := $(PY3_COMMON)/site-packages/pyMo/vim/vsan

# Find the target location for the correct python version
# Find the target location for the correct python version
TARGET_LOC = $(shell $(SSH) root@$(ESX) \
"if [ -d $(TARGET2) ] ; then echo $(TARGET2) ; else echo $(TARGET3); fi")

# Note: in ESX source, here are the location:
# Note: in ESX source, here are the location:
#bora/vsan/<component>/esx/pyMo (Impl and __init)
#bora/vsan/pyvmodl (model)

Expand All @@ -45,7 +45,9 @@ PYFILES := $(MODEL) $(EXT) $(IMPL)
TESTFILES := $(shell find . -name '*_test.py')
TMP_LOC := $(shell echo /tmp/dockvol-vmodl_unittest$$RANDOM)

deploy:
ifdef INSTALL_VMODL

deploy:
@echo Making test dir...
$(SSH) root@$(ESX) 'mkdir -p $(TARGET2) $(TARGET3) $(TMP_LOC)'
@echo Copying VMODL python files to root@$(ESX):$(TARGET2) ...
Expand All @@ -56,8 +58,8 @@ deploy:
@$(SCP) $(TESTFILES) $(TO_ESX_BIN) $(TO_ESX_PY) root@$(ESX):$(TMP_LOC)

# Testing. Note that vsanmgmtd neeeds a second or two between 'restart' returns
# and the daemon start to really listen
test: deploy
# and the daemon start to really listen
test: deploy
@echo Restarting VSAN mgmt daemon and running tests...
@$(SSH) root@$(ESX) \
'set -x ; \
Expand All @@ -74,3 +76,13 @@ copy_to_payload:
mkdir -p ../$(VMDKOPS_PAYLOAD)$(TARGET2) ../$(VMDKOPS_PAYLOAD)$(TARGET3)
cp $(PYFILES) $(TESTFILES) ../$(VMDKOPS_PAYLOAD)$(TARGET2)
cp $(PYFILES) $(TESTFILES) ../$(VMDKOPS_PAYLOAD)$(TARGET3)

else

deploy test copy_to_payload:
@echo "Ignoring VMODL '$@' target."
@echo See https://github.com/vmware/docker-volume-vsphere/pull/975 for details.

endif


10 changes: 9 additions & 1 deletion esx_service/vmodl/vmodl_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,15 @@
# stub = vmodl_test.connect_to_vcs()
# vmodl_test.get_tenants(stub) # print tenant list

import sys, ssl
import os, sys

# nothing to test until we put VMODL back in the VIB
# See https://github.com/vmware/docker-volume-vsphere/pull/975 for details.
if "INSTALL_VMODL" not in os.environ:
print("Skipping VMODL test - INSTALL_VMODL is not defined")
sys.exit(0)

import ssl
sys.path.append('/lib64/python3.5/site-packages/pyMo/vim/vsan')
sys.path.append('/lib/python2.7/site-packages/pyMo/vim/vsan')

Expand Down

0 comments on commit d45c2ec

Please sign in to comment.