Modify the image such that it detects the need to update, or start the vm-node without any existing image/image.info.
Start dispatch.
Kill dispatch before updating the image finishes.
You will notice that the image.info file in /image has been updated before the image file is completely updated. Thus, when you attempt to run dispatch again, there will be problems, as the image.info is there but the corresponding image either missing or missing part.
To fix the problem, only write image.info to file after the image has been completely copied from dispatch.
Also, verify the same logic for vm-node to vm-inst copying.
Reproduction steps:
You will notice that the image.info file in/image has been updated before the image file is completely updated. Thus, when you attempt to run dispatch again, there will be problems, as the image.info is there but the corresponding image either missing or missing part.
To fix the problem, only write image.info to file after the image has been completely copied from dispatch.
Also, verify the same logic for vm-node to vm-inst copying.