CLOUDSTACK-7345 changed dd blocksize to 128k when using NFS.

Signed-off-by: Daan Hoogland <daan@onecht.net>
(cherry picked from commit 8b7130fa65a3ce010a54015b3350b94b56414462)
This commit is contained in:
Brenn Oosterbaan 2014-08-14 09:35:14 +02:00 committed by Daan Hoogland
parent a38bb389b2
commit 7c92bac4a3

View File

@ -200,8 +200,13 @@ def isfile(path, isISCSI):
def copyfile(fromFile, toFile, isISCSI): def copyfile(fromFile, toFile, isISCSI):
logging.debug("Starting to copy " + fromFile + " to " + toFile) logging.debug("Starting to copy " + fromFile + " to " + toFile)
errMsg = '' errMsg = ''
if isISCSI:
bs = "4M"
else:
bs = "128k"
try: try:
cmd = ['dd', 'if=' + fromFile, 'iflag=direct', 'of=' + toFile, 'oflag=direct', 'bs=4M'] cmd = ['dd', 'if=' + fromFile, 'iflag=direct', 'of=' + toFile, 'oflag=direct', 'bs=' + bs]
txt = util.pread2(cmd) txt = util.pread2(cmd)
except: except:
try: try: