bugfix: Graceful shutdown of VM 43/12443/1
authorMartin Klozik <martinx.klozik@intel.com>
Thu, 14 Apr 2016 19:18:16 +0000 (20:18 +0100)
committerMartin Klozik <martinx.klozik@intel.com>
Tue, 19 Apr 2016 12:06:48 +0000 (13:06 +0100)
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 <martinx.klozik@intel.com>
Reviewed-by: Maryam Tahhan <maryam.tahhan@intel.com>
Reviewed-by: Al Morton <acmorton@att.com>
Reviewed-by: Christian Trautman <ctrautma@redhat.com>
Reviewed-by: Brian Castelli <brian.castelli@spirent.com>
vnfs/qemu/qemu.py

index 9cb23ac..686fb43 100644 (file)
@@ -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):
         """