wheresMyCOSVMDKAt.pl

Version 2

    This script will try to extract the location of your vSphere ESX 4.0 COS VMDK (Service Console)  path, the size of the VMDK and the host in which it belongs to. This is done by doing a search across VMFS datastores and extracting sysboot-vmkernel-late.log which includes the mapping of the host as noted here: vSphere ESX 4.0 tips/tricks. 99.9% of the time, this entry is valid and available, but through some testing, I've seen it not be there but you will still get the size and location of the COS VMDK, just not the hostname mapping. This log is locally downloaded to your system and parsed for the HostName entry and upon completion, the logs will be removed.

     

    The script can be executed across entire vCenter, datacenter, cluster or individual ESX host including specifying specific datastores to search which should be in double quotes, separated by comma e.g. "ds1,d2,ds3,ds4"

     

    Requirements:

    vCenter 4.0 & ESX 4.0

    vMA 4.0 or vCLI 4.0

     

    Sample Execution:

     

    Execute against vCenter datacenter:

    [vi-admin@scofield ~]$ ./wheresMyCOSVMDKAt.pl --server reflex.primp-industries.com --datacenter "Primp-Production"
    
    16.00 GB        [himalaya-local-SATA.RE4-GP:Boot] cos-4a47fcee-8675-0c80-fea8-003048d9586a/default-cos.vmdk
    himalaya.primp-industries.com
    

     

     

    Execute against vCenter cluster and searching only 2 specific datastores:

    [vi-admin@scofield ~]$ ./wheresMyCOSVMDKAt.pl --server reflex.primp-industries.com --cluster "Primp-Stage" --datastore "esx-4-local-storage-1,esx-5-local-storage-1"
    
    19.53 GB        [esx-4-local-storage-1] cos-4aaf9f00-ac91-897e-bbe5-0024e86d92c1/default-cos.vmdk
    esx-4.primp-industries.com
    
    19.53 GB        [esx-5-local-storage-1] cos-4aaf9f90-ae09-7e95-5479-0024e86d92cedefault-cos.vmdk
    esx-5.primp-industries.com
    

     

     

    Execute against individual ESX host:

    [vi-admin@scofield ~]$ ./wheresMyCOSVMDKAt.pl --server esx-5.primp-industries.com
    19.53 GB        [esx-5-local-storage-1] cos-4aaf9f90-ae09-7e95-5479-0024e86d92cedefault-cos.vmdk