summaryrefslogtreecommitdiff
path: root/ironic_python_agent/shell
diff options
context:
space:
mode:
authorMathieu Mitchell <mmitchell@iweb.com>2014-10-16 16:51:44 -0400
committerMathieu Mitchell <mmitchell@iweb.com>2014-10-20 10:27:02 -0400
commite53e297a5e920ca4621acfca6c4896a51ba4754d (patch)
treec831f89d5b46010d7f2d85c2e2101b5f72c9f4e9 /ironic_python_agent/shell
parent082cf29cec31efda2d63eeb9dda8c74e396be6eb (diff)
downloadironic-python-agent-e53e297a5e920ca4621acfca6c4896a51ba4754d.tar.gz
Write image directly to disk
Write image directly to disk by telling qemu-img that the output file is the disk. Still uses O_DIRECT directly within qemu-img. This avoids the need to have a huge amount of system memory to be able to deploy an image that contains a huge disk. The only feature left behind by that commit is the 64K block size. Change-Id: If60bcd82581b2ea76c4acbc3eaa3f317d2ee6590
Diffstat (limited to 'ironic_python_agent/shell')
-rwxr-xr-xironic_python_agent/shell/write_image.sh12
1 files changed, 3 insertions, 9 deletions
diff --git a/ironic_python_agent/shell/write_image.sh b/ironic_python_agent/shell/write_image.sh
index 272e342b..ba589419 100755
--- a/ironic_python_agent/shell/write_image.sh
+++ b/ironic_python_agent/shell/write_image.sh
@@ -38,14 +38,8 @@ DEVICE="$2"
log "Erasing existing mbr from ${DEVICE}"
dd if=/dev/zero of=$DEVICE bs=512 count=10
-## Doing two steps allows us to use dd, which allows us to tweak things like
-## blocksize and allows use of direct io
-# Converts image to raw
-log "Converting $IMAGEFILE to RAW format"
-qemu-img convert -O raw $IMAGEFILE /tmp/image.raw
-
-# Write image onto device
-log "Imaging $DEVICE"
-dd if=/tmp/image.raw of=$DEVICE bs=64K oflag=direct
+log "Imaging $IMAGEFILE to $DEVICE"
+qemu-img convert -t directsync -O raw $IMAGEFILE $DEVICE
+sync
log "${DEVICE} imaged successfully!"