use directIO flags when dd'ing template

This makes sure dom0 in xenserver doesn't get hammered
when copying templates. It doesn't make sense to use
the cache of dom0 as the template does not fit in
memory. The directIO flags prevent it from trying.

(cherry picked from commit 4e1527e87aaaa87d14d3c7d3a6782b80cbf36a8c)


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/66b77380
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/66b77380
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/66b77380

Branch: refs/heads/master
Commit: 66b77380d06a38e24e3bd84e4804d3ff8d19ff95
Parents: 453c5b3
Author: Remi Bergsma <rberg...@schubergphilis.com>
Authored: Mon Dec 15 16:36:35 2014 +0100
Committer: Daan Hoogland <d...@onecht.net>
Committed: Tue Dec 16 10:49:57 2014 +0100

----------------------------------------------------------------------
 scripts/vm/hypervisor/xenserver/copy_vhd_from_secondarystorage.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/66b77380/scripts/vm/hypervisor/xenserver/copy_vhd_from_secondarystorage.sh
----------------------------------------------------------------------
diff --git a/scripts/vm/hypervisor/xenserver/copy_vhd_from_secondarystorage.sh 
b/scripts/vm/hypervisor/xenserver/copy_vhd_from_secondarystorage.sh
index 098015a..61c65ea 100755
--- a/scripts/vm/hypervisor/xenserver/copy_vhd_from_secondarystorage.sh
+++ b/scripts/vm/hypervisor/xenserver/copy_vhd_from_secondarystorage.sh
@@ -104,7 +104,7 @@ copyvhd()
     exit 0
   fi
   if [ "${parent##*vhd has}" = " no parent" ]; then
-    dd if=$srcvhd of=$desvhd bs=2M     
+    dd if=$srcvhd of=$desvhd bs=2M oflag=direct iflag=direct
     if [ $? -ne 0 ]; then
       echo "31#failed to dd $srcvhd to $desvhd"
       cleanup

Reply via email to