Please think about your parameters here, why we need env and image_filename in the same time, and test here seems not used any more. Do we really need env here or we can just pass vm object to this function?