Commit e3cfd3ec authored by Łukasz Nowak's avatar Łukasz Nowak

packer: Do not write during quick test

In order to being able play with generated image many times avoid
needless writes there by using qemu -snapshot switch.
parent 2bce2cd6
......@@ -83,6 +83,16 @@ In order to test one image (after unzip), you can run:
bash util/quick-test packer-centos72 "-display sdl"
Watch out. quick-test will NOT write data into the image, so after exiting,
the image will be reverted back to its original state.
In order to have your work saved using quick test, please use information from
qemu man page:
-snapshot
Write to temporary files instead of disk image files. In this case, the raw disk image you use is not written back. You can however force the write back by
pressing C-a s.
Extra
-----
......
#/bin/bash -e
# Quick command to test the VM image with output file.
/usr/bin/qemu-system-x86_64 $2 -drive file=$1,if=virtio,cache=writeback,discard=ignore -boot once=d -m 512M -name test -machine type=pc,accel=kvm -netdev user,id=user.0,hostfwd=tcp::3213-:22 -device virtio-net,netdev=user.0 -vnc 0.0.0.0:47
echo "Changes will not be written"
echo "To force write please use:"
echo "man qemu: You can however force the write back by pressing C-a s."
/usr/bin/qemu-system-x86_64 $2 -snapshot -drive file=$1,if=virtio,cache=writeback,discard=ignore -boot once=d -m 512M -name test -machine type=pc,accel=kvm -netdev user,id=user.0,hostfwd=tcp::3213-:22 -device virtio-net,netdev=user.0 -vnc 0.0.0.0:47
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment