From c7cc50cea185a2eb4b26958c985fb8c8fdfd9439 Mon Sep 17 00:00:00 2001 From: Martin Klozik Date: Thu, 14 Apr 2016 20:18:16 +0100 Subject: bugfix: Graceful shutdown of VM Cleanup phase of PVVP scenario sometimes causes server reboot. Following updates were made to prevent reboots: * sleep after VM OS shutdown allows QEMU to finish its own shutdown procedure * shared dir was mounted as read only to prevent its modification, which sometimes causes delays during shutdown; Also warning messages are causing CI jobs failures. Change-Id: I1607e79beeee343893496efe01ca0be5ea684a9d JIRA: VSPERF-271 Signed-off-by: Martin Klozik Reviewed-by: Maryam Tahhan Reviewed-by: Al Morton Reviewed-by: Christian Trautman Reviewed-by: Brian Castelli --- vnfs/qemu/qemu.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'vnfs') diff --git a/vnfs/qemu/qemu.py b/vnfs/qemu/qemu.py index 9cb23ac6..686fb431 100644 --- a/vnfs/qemu/qemu.py +++ b/vnfs/qemu/qemu.py @@ -20,6 +20,7 @@ import logging import locale import re import subprocess +import time from conf import settings as S from conf import get_test_param @@ -139,6 +140,8 @@ class IVnfQemu(IVnf): # turn off VM self.execute_and_wait('poweroff', 120, "Power down") + # VM OS is off, but wait until qemu shutdowns + time.sleep(2) # just for case that graceful shutdown failed super(IVnfQemu, self).stop() @@ -257,14 +260,15 @@ class IVnfQemu(IVnf): Mount shared directory and copy DPDK and l2fwd sources """ # mount shared directory - self.execute_and_wait('umount ' + S.getValue('OVS_DPDK_SHARE')) + self.execute_and_wait('umount /dev/sdb1') self.execute_and_wait('rm -rf ' + S.getValue('GUEST_OVS_DPDK_DIR')) self.execute_and_wait('mkdir -p ' + S.getValue('OVS_DPDK_SHARE')) - self.execute_and_wait('mount -o iocharset=utf8 /dev/sdb1 ' + + self.execute_and_wait('mount -o ro,iocharset=utf8 /dev/sdb1 ' + S.getValue('OVS_DPDK_SHARE')) self.execute_and_wait('mkdir -p ' + S.getValue('GUEST_OVS_DPDK_DIR')) self.execute_and_wait('cp -ra ' + os.path.join(S.getValue('OVS_DPDK_SHARE'), dirname) + ' ' + S.getValue('GUEST_OVS_DPDK_DIR')) + self.execute_and_wait('umount /dev/sdb1') def _configure_disable_firewall(self): """ -- cgit 1.2.3-korg