summaryrefslogtreecommitdiffstats
path: root/xci
diff options
context:
space:
mode:
Diffstat (limited to 'xci')
-rwxr-xr-xxci/config/user-vars6
-rwxr-xr-xxci/scripts/vm/start-new-vm.sh22
-rwxr-xr-xxci/xci-deploy.sh27
3 files changed, 38 insertions, 17 deletions
diff --git a/xci/config/user-vars b/xci/config/user-vars
index ecde6db9..7c99ee9d 100755
--- a/xci/config/user-vars
+++ b/xci/config/user-vars
@@ -49,10 +49,10 @@ export OPNFV_OSA_PLAYBOOK=${OPNFV_OSA_PLAYBOOK:-"$OPENSTACK_OSA_PATH/playbooks/s
# Set the verbosity for ansible
#
# Examples:
-# ANSIBLE_VERBOSITY="-v"
+# XCI_ANSIBLE_VERBOSITY="-v"
# or
-# ANSIBLE_VERBOSITY="-vvvv"
-export ANSIBLE_VERBOSITY=${ANSIBLE_VERBOSITY:-""}
+# XCI_ANSIBLE_VERBOSITY="-vvvv"
+export XCI_ANSIBLE_VERBOSITY=${XCI_ANSIBLE_VERBOSITY:-""}
export LOG_PATH=${LOG_PATH:-${XCI_DEVEL_ROOT}/opnfv/logs}
export RUN_TEMPEST=${RUN_TEMPEST:-false}
# Set this to to true to force XCI to re-create the target OS images
diff --git a/xci/scripts/vm/start-new-vm.sh b/xci/scripts/vm/start-new-vm.sh
index c374071c..65133edc 100755
--- a/xci/scripts/vm/start-new-vm.sh
+++ b/xci/scripts/vm/start-new-vm.sh
@@ -38,8 +38,22 @@ declare -r BASE_PATH=$(dirname $(readlink -f $0) | sed "s@/xci/.*@@")
echo "Preparing new virtual machine '${NAME}'..."
# NOTE(hwoarang) This should be removed when we move the dib images to a central place
+_retries=20
echo "Building '${OS}' image (tail build.log for progress and failures)..."
-$BASE_PATH/xci/scripts/vm/build-dib-os.sh ${OS} > build.log 2>&1
+while [[ $_retries -ne 0 ]]; do
+ if pgrep build-dib-os.sh &>/dev/null; then
+ echo "There is another dib process running... ($_retries retries left)"
+ sleep 60
+ (( _retries = _retries - 1 ))
+ else
+ if [[ -n ${JENKINS_HOME} ]]; then
+ $BASE_PATH/xci/scripts/vm/build-dib-os.sh ${OS} 2>&1 | tee build.log
+ else
+ $BASE_PATH/xci/scripts/vm/build-dib-os.sh ${OS} > build.log 2>&1
+ fi
+ break
+ fi
+done
[[ ! -e ${OS}.qcow2 ]] && echo "${OS}.qcow2 not found! This should never happen!" && exit 1
@@ -78,7 +92,7 @@ sudo virsh undefine ${NAME} || true
echo "Installing virtual machine '${NAME}'..."
sudo virt-install -n ${NAME} --memory ${MEMORY} --vcpus ${NCPUS} --cpu ${CPU} \
- --import --disk=${OS}.qcow2 --network network=${NETWORK} \
+ --import --disk=${OS}.qcow2,cache=unsafe --network network=${NETWORK} \
--graphics none --hvm --noautoconsole
_retries=30
@@ -177,7 +191,7 @@ set +e
_has_test=true
echo "Verifying test script exists..."
-$vm_ssh $_ip "bash -c 'stat ~/$(basename ${BASE_PATH})/run_jenkins_test.sh'"
+$vm_ssh $_ip "bash -c 'stat ~/releng-xci/run_jenkins_test.sh'"
if [[ $? != 0 ]]; then
echo "Failed to find a 'run_jenkins_test.sh' script..."
if ${DEFAULT_XCI_TEST}; then
@@ -196,7 +210,7 @@ fi
if ${_has_test}; then
echo "Running test..."
- $vm_ssh $_ip "bash ~/$(basename ${BASE_PATH})/run_jenkins_test.sh"
+ $vm_ssh $_ip "bash ~/releng-xci/run_jenkins_test.sh"
xci_error=$?
else
echo "No jenkins test was found. The virtual machine will remain idle!"
diff --git a/xci/xci-deploy.sh b/xci/xci-deploy.sh
index 95856105..80ff53b6 100755
--- a/xci/xci-deploy.sh
+++ b/xci/xci-deploy.sh
@@ -123,7 +123,7 @@ cd $XCI_PATH/playbooks
sudo pip uninstall -y ansible || true
sudo -H pip uninstall -y ansible || true
sudo pip install ansible==${XCI_ANSIBLE_PIP_VERSION}
-ansible-playbook -i inventory provision-vm-nodes.yml
+ansible-playbook ${XCI_ANSIBLE_VERBOSITY} -i inventory provision-vm-nodes.yml
cd ${OPENSTACK_BIFROST_PATH}
bash ./scripts/bifrost-provision.sh
echo "-----------------------------------------------------------------------"
@@ -143,10 +143,17 @@ echo
echo "Info: Configuring localhost for openstack-ansible"
echo "-----------------------------------------------------------------------"
-# NOTE(hwoarang) we need newer ansible to work on the OSA playbooks
+# NOTE(hwoarang) we need newer ansible to work on the OSA playbooks. Make sure
+# all installations are gone. This is ugly and has to be removed as soon as we
+# are able to deploy bifrost in vent or when bifrost start working with newest
+# ansible
+pip uninstall -y ansible || true
+sudo -H pip uninstall -y ansible || true
sudo pip install --force-reinstall ansible==${XCI_ANSIBLE_PIP_VERSION}
+# Start fresh
+hash -r
cd $XCI_PATH/playbooks
-ansible-playbook -i inventory configure-localhost.yml
+ansible-playbook ${XCI_ANSIBLE_VERBOSITY} -i inventory configure-localhost.yml
echo "-----------------------------------------------------------------------"
echo "Info: Configured localhost host for openstack-ansible"
@@ -164,7 +171,7 @@ echo "Info: Configured localhost host for openstack-ansible"
echo "Info: Configuring opnfv deployment host for openstack-ansible"
echo "-----------------------------------------------------------------------"
cd ${XCI_DEVEL_ROOT}
-ansible-playbook -i ${OPNFV_XCI_PATH}/playbooks/inventory ${OPNFV_XCI_PATH}/playbooks/configure-opnfvhost.yml
+ansible-playbook ${XCI_ANSIBLE_VERBOSITY} -i ${OPNFV_XCI_PATH}/playbooks/inventory ${OPNFV_XCI_PATH}/playbooks/configure-opnfvhost.yml
echo "-----------------------------------------------------------------------"
echo "Info: Configured opnfv deployment host for openstack-ansible"
@@ -183,7 +190,7 @@ if [[ $XCI_FLAVOR != "aio" ]]; then
echo "Info: Configuring target hosts for openstack-ansible"
echo "-----------------------------------------------------------------------"
cd $OPNFV_XCI_PATH/playbooks
- ansible-playbook -i inventory configure-targethosts.yml
+ ansible-playbook ${XCI_ANSIBLE_VERBOSITY} -i inventory configure-targethosts.yml
echo "-----------------------------------------------------------------------"
echo "Info: Configured target hosts"
fi
@@ -195,7 +202,7 @@ fi
#-------------------------------------------------------------------------------
echo "Info: Setting up target hosts for openstack-ansible"
echo "-----------------------------------------------------------------------"
-ssh root@$OPNFV_HOST_IP "openstack-ansible \
+ssh root@$OPNFV_HOST_IP "openstack-ansible ${XCI_ANSIBLE_VERBOSITY} \
$OPENSTACK_OSA_PATH/playbooks/setup-hosts.yml | tee setup-hosts.log "
scp root@$OPNFV_HOST_IP:~/setup-hosts.log $LOG_PATH/setup-hosts.log
echo "-----------------------------------------------------------------------"
@@ -217,7 +224,7 @@ echo "Info: Set up target hosts for openstack-ansible successfuly"
echo "Info: Gathering facts"
echo "-----------------------------------------------------------------------"
ssh root@$OPNFV_HOST_IP "cd $OPENSTACK_OSA_PATH/playbooks; \
- ansible -m setup -a gather_subset=network,hardware,virtual all"
+ ansible ${XCI_ANSIBLE_VERBOSITY} -m setup -a gather_subset=network,hardware,virtual all"
echo "-----------------------------------------------------------------------"
#-------------------------------------------------------------------------------
@@ -228,7 +235,7 @@ echo "-----------------------------------------------------------------------"
echo "Info: Setting up infrastructure"
echo "-----------------------------------------------------------------------"
echo "xci: running ansible playbook setup-infrastructure.yml"
-ssh root@$OPNFV_HOST_IP "openstack-ansible \
+ssh root@$OPNFV_HOST_IP "openstack-ansible ${XCI_ANSIBLE_VERBOSITY} \
$OPENSTACK_OSA_PATH/playbooks//setup-infrastructure.yml | tee setup-infrastructure.log"
scp root@$OPNFV_HOST_IP:~/setup-infrastructure.log $LOG_PATH/setup-infrastructure.log
echo "-----------------------------------------------------------------------"
@@ -262,7 +269,7 @@ echo "Info: Database cluster verification successful!"
#-------------------------------------------------------------------------------
echo "Info: Installing OpenStack on target hosts"
echo "-----------------------------------------------------------------------"
-ssh root@$OPNFV_HOST_IP "openstack-ansible \
+ssh root@$OPNFV_HOST_IP "openstack-ansible ${XCI_ANSIBLE_VERBOSITY} \
$OPENSTACK_OSA_PATH/playbooks/setup-openstack.yml | tee opnfv-setup-openstack.log"
scp root@$OPNFV_HOST_IP:~/opnfv-setup-openstack.log $LOG_PATH/opnfv-setup-openstack.log
echo "-----------------------------------------------------------------------"
@@ -292,4 +299,4 @@ USERNAME=$(ssh -q root@192.168.122.2 awk "/OS_USERNAME=./" openrc)
PASSWORD=$(ssh -q root@192.168.122.2 awk "/OS_PASSWORD=./" openrc)
echo "Info: Admin username - ${USERNAME##*=}"
echo "Info: Admin password - ${PASSWORD##*=}"
-echo "Info: It is recommended to change the default password." \ No newline at end of file
+echo "Info: It is recommended to change the default password."