Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- # Copyright 2008 VMware Inc.,
- MountDisk()
- {
- local COSCoreFile=
- if [ ! -f "$@" ] ; then
- return ${FALSE}
- fi
- Exec vsd -scu -f "$@" || {
- if [ "${VERBOSE}" != "no" ] ; then
- Error "Failed to mount VMDK Disk: $@"
- else
- Log "Failed to mount VMDK Disk: $@"
- fi
- return ${FALSE}
- }
- # Awful hack 'n' slash to automatically open second VMDK
- # By J.Piscaer, Virtual Lifestyle, November 4th, 2010
- Exec vsd -scu -f /vmfs/volumes/lun1/esxconsole-[longnumber]/var_cache_esxupdate.vmdk || {
- if [ "${VERBOSE}" != "no" ] ; then
- Error "Failed to mount VMDK Disk: $@"
- else
- Log "Failed to mount VMDK Disk: $@"
- fi
- return ${FALSE}
- }
- # End awful hack.
- COSCoreFile="$(esxcfg-advcfg -qg /Misc/CosCorefile)"
- if [ "${COSCoreFile}" = "" -o ! -d "$(dirname "${COSCoreFile}")" ] ; then
- Exec mkdir -p "$(dirname "$@")/core-dumps/"
- Exec esxcfg-advcfg -qs "$(dirname "$@")/core-dumps/cos-core" /Misc/CosCorefile
- fi
- return ${TRUE}
- }
- CommandLineVMDK="$(GetBootOption 'cosvmdk')"
- if [ -n "${CommandLineVMDK}" ] ; then
- Log "COS VMDK Specified on Kerenel Boot Line: ${CommandLineVMDK}"
- MountDisk "${CommandLineVMDK}" || return ${FATAL_ERROR}
- return ${SUCCESS}
- fi
- ConfigVMDK="$(GetRawConfigOption '/boot/cosvmdk')"
- if [ -n "${ConfigVMDK}" ] ; then
- Log "COS VMDK Specified in esx.conf: ${ConfigVMDK}"
- MountDisk "${ConfigVMDK}" || return ${FATAL_ERROR}
- return ${SUCCESS}
- fi
- Log "Scanning VMFS for COS VMDK..."
- for disk in /vmfs/volumes/*/esxconsole-*/esxconsole.vmdk ; do
- Log "Attempting to use VMDK found by inspection: ${disk}"
- MountDisk "${disk}" || continue
- return ${SUCCESS}
- done
- Log "Scanning VMFS for legacy COS VMDK..."
- for disk in /vmfs/volumes/*/cos/default-cos.vmdk ; do
- Log "Attempting to use VMDK found by inspection: ${disk}"
- MountDisk "${disk}" || continue
- return ${SUCCESS}
- done
- Error "Unable to find COS VMDK"
- return ${FATAL_ERROR}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement