Enable SRM on vsphere by replacing the workflow of reading settings from cdrom with reading from attached independent disk

We run three steps to create the vmdk file as follows. Then use the created vmdk file to upload and attach to VM as independent disk.

           Convert a file with content, such as environment settings, to an iso file
                        Tool: genisoimage (ref: http://linux.die.net/man/1/genisoimage)
                        Command: `genisoimage -o #{iso_file_path} #{original_file_path}`

           Convert the iso file to one vmdk file
                        Tool: qemu-img (To install, run `sudo apt-get install qemu`)
                        Command: `qemu-img convert -O vmdk #{iso_file} #{env.vmdk}`

           Convert the vmdk file to esx type vmdk files (one descriptor file, i.e. env.vmdk and one content file, i.e. env-flat.vmdk)
                        Tools: vmware-vdiskmanager (VMware Virtual Disk Manager, ref: http://www.vmware.com/pdf/VirtualDiskManager.pdf)
                        Command: `vmware-vdiskmanager -r #{original_vmdk_file} -t 4 #{new_vmdk_file}`
Note:
You need to install qemu and vdiskmanager and make sure vdiskmanager is in your system path
Instruction on how to install vdiskmanager:
Download vdiskmanager.tar from link https://github.com/vchs/bosh/blob/wip_remove_iso_f1/stemcell_builder/stages/system_vdiskmanager/assets/vdiskmanager.tar
Then run the following commands:
tar -xvf vdiskmanager.tar
module_dir=`ls -d /lib/modules/3.*-virtual | tail -1`
install_dir="${module_dir}/vdiskmanager"
perl vmware-vix-disklib-distrib/vmware-install.pl "$install_dir"
When vm will be migrated to another datastore env.json won't be migrated. In case of ISO image we can determine location of env.json based on cdrom information about ISO since ISO is not being migrated with vm. In the case that a CDROM drive was never attached to a VM we will have no way of determining where the env.iso or env.json files are located. This will break get_current_env method and will also leave old env.json around after VM is deleted. Do you think there is a way you can determine env.json location after vm was migrated?