VMware Cloud Community
Pegasjus
Contributor
Contributor

vmkdump retrieval

Hi,

I was wondering, does anybody have a script or a oneliner for that matter on how to retrieve vmkdump files?

//Pegasjus.

0 Kudos
7 Replies
LucD
Leadership
Leadership

How did you configure the location of the vmkdump files (see KB2077516).

If they are on a VMFS datastore, you can use the Copy-DatastoreItem cmdlet.

You can also get the diagnostics bundle, which should include the vmkdump, via the Get-Log cmdlet with the Bundle switch.




Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Pegasjus
Contributor
Contributor

Hej Luc,

thank you for coming back to me. They are stored on the datastore.

The general idea was to create something that can run once a month (or more often really) to highlight if there are files on the drive. I have something like that to check for old snapshots for example and it's something that would be helpful in order to recover storage. An  add on for later is to check for dead storage (i.e. machines removed from vcenter but not deleted from the datastores).


I think the get-log creates too much, as I want to run it against a vcenter, but how do you see the copy-datastoreItem working out?

//Pegasjus

0 Kudos
LucD
Leadership
Leadership

To discover the files on your datastores you could use something like my Get-Dump function Remove old VM monitor dump files

Indeed, the Get-Log cmdlet creates a complete diagnostics bundle.

Once you have the path to the dump file, you can copy it to local storage with the Copy-DatastoreItem cmdlet, provided you want to keep these dump files on local storage


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Pegasjus
Contributor
Contributor

Hi Luc,

I tried your program yesterday actually but the only thing that it gives me is the following:

PowerCLI C:\Scripts\PowerCLI> Get-Datastore datastorename.* | .\Get-Dump.ps1

PowerCLI C:\Scripts\PowerCLI>

and I know if I run the first part I get datastores returned.

If I run it the other way around in your examples in the script:

PowerCLI C:\Scripts\PowerCLI> .\Get-Dump.ps1 -Datastore <name of datastore>

PowerCLI C:\Scripts\PowerCLI>

Are there specific requirements that I've missed out on in relation to PowerCLI/shell?

******************************************************************************************

PowerCLI C:\Scripts\PowerCLI> Get-VIToolkitVersion

PowerCLI Version

----------------

   VMware vSphere PowerCLI 5.5 Release 2 Patch 1 build 1931983

---------------

Snapin Versions

---------------

   VMWare AutoDeploy PowerCLI Component 5.5 build 1890764

   VMWare ImageBuilder PowerCLI Component 5.5 build 1890764

   VMware License PowerCLI Component 5.5 build 1265954

   VMware VDS PowerCLI Component 5.5 build 1926677

   VMware vSphere PowerCLI Component 5.5 Patch 1 build 1926677

$psversiontable

Name                           Value

----                           -----

PSVersion                      4.0

WSManStackVersion              3.0

SerializationVersion           1.1.0.1

CLRVersion                     4.0.30319.34209

BuildVersion                   6.3.9600.16406

PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0}

PSRemotingProtocolVersion      2.2

//Pegasjus

0 Kudos
LucD
Leadership
Leadership

What is in Get-Dump.ps1 ?

Do you actually call the function in that .ps1 file ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Pegasjus
Contributor
Contributor

ok so I am doing something wrong Smiley Happy

I call it like you put in the examples, I assumed that the script you referred to was a ps1 script and saved it as get-dump.ps1.

//Pegasjus.

0 Kudos
LucD
Leadership
Leadership

Can you perhaps attach your .ps1 file so I can have a look ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos