diff options
| author | thaibault | 2013-08-08 16:24:35 +0200 |
|---|---|---|
| committer | torben | 2013-08-08 16:24:35 +0200 |
| commit | 57bed0e2242eeb9359ddc97009af4e9c2364d442 (patch) | |
| tree | 7157df9ba37c27d085720f9c3ca9789f9da973d5 /remote/modules/vmplayer/data/opt/openslx | |
| parent | [systemd] Scientific Linux: Chain m4->autoconf->automake compiles now. (diff) | |
| download | tm-scripts-57bed0e2242eeb9359ddc97009af4e9c2364d442.tar.gz tm-scripts-57bed0e2242eeb9359ddc97009af4e9c2364d442.tar.xz tm-scripts-57bed0e2242eeb9359ddc97009af4e9c2364d442.zip | |
Add persistent bootable virtual machine features.
Diffstat (limited to 'remote/modules/vmplayer/data/opt/openslx')
| -rwxr-xr-x[-rw-r--r--] | remote/modules/vmplayer/data/opt/openslx/etc/vmware/run-virt.include | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/remote/modules/vmplayer/data/opt/openslx/etc/vmware/run-virt.include b/remote/modules/vmplayer/data/opt/openslx/etc/vmware/run-virt.include index 675835a9..9a817d65 100644..100755 --- a/remote/modules/vmplayer/data/opt/openslx/etc/vmware/run-virt.include +++ b/remote/modules/vmplayer/data/opt/openslx/etc/vmware/run-virt.include @@ -230,7 +230,9 @@ MemTrimRate = "-1" # ide-disks ide0:0.present = "$ide" ide0:0.fileName = "$diskfile" -ide0:0.mode = "independent-nonpersistent" +## Edited for persistent mode. +ide0:0.mode = "independent-${diskmode}" +## ide1:0.present = "$cdrom0" ide1:0.autodetect = "TRUE" ide1:0.fileName = "auto detect" @@ -245,7 +247,9 @@ scsi0.present = "$scsi" scsi0:0.present = "$scsi" scsi0:0.fileName = "$diskfile" scsi0.virtualDev = "$hddrv" -scsi0:0.mode = "independent-nonpersistent" +## Edited for persistent mode. +scsi0:0.mode = "independent-${diskmode}"$stateFileConfiguration +## # floppies floppy0.present = "$floppy0" @@ -459,7 +463,7 @@ esac # check for whitelisted HW-3D . /opt/openslx/config -local FORCE3D="" +FORCE3D="" if [ -n "$SLX_VMWARE_3D" ]; then FORCE3D='mks.gl.allowBlacklistedDrivers = "TRUE"' fi @@ -512,6 +516,20 @@ esac # check if ide/scsi and hwver of image # read only the first 30 lines to be sure imghead=$(head -n 30 "${diskfile}") +## Added to handle persistent snapshots. +if [[ "$originalVMDKFilePath" ]]; then + echo "Select \"${originalVMDKFilePath}\" as information base for \"${diskfile}\"." + imghead=$(head -n 30 "$originalVMDKFilePath") && \ + # Support suspend mode. + stateFilePath="$(readlink -f "$(dirname "$diskfile")/"*.vmss)" && \ + if [ -f "$stateFilePath" ]; then + echo "Found state file \"$stateFilePath\"." && \ + stateFileConfiguration=" +checkpoint.vmState = \"$stateFilePath\"" + fi + POSTRUN="stateFilePath=\"\$(readlink --canonicalize \"${confdir}/\"*.vmss)\" && memoryFilePath=\"\$(readlink --canonicalize \"${confdir}/\"*.vmem)\" && [ -f \"\$stateFilePath\" ] && echo \"Saving state and memory file \\\"\$stateFilePath\\\" and \\\"\$memoryFilePath\\\".\" && mv --force \"\$stateFilePath\" \"$(dirname "$diskfile")/\" && mv --force \"\$memoryFilePath\" \"$(dirname "$diskfile")/\"" +fi +## hddrv=$(echo "${imghead}" | grep -m1 -ia "ddb.adapterType" | awk -F '"' '{print $2}') hwver=$(echo "${imghead}" | grep -m1 -ia "ddb.virtualHWVersion" | awk -F '"' '{print $2}') case "${hddrv}" in @@ -557,7 +575,9 @@ cp "/opt/openslx/etc/vmware/nvram" "$confdir/nvram" 2>/dev/null # log script information writelog "# File created by $0 (VMversion ${vmversion})\n# on $(date)\n" -writelog "Starting with non-persistent mode ...\n" +## Edited for persistent mode. +writelog "Starting with ${diskmode} mode ...\n" +## # write all results to logfile # log disksetup |
