VMware {code} Community
giladb
Contributor
Contributor

What is tmpdir used for ?

One of the configuration items used by VDDK is tmpdir.

As far as I could tell, this is where logs are written, assuming log function pointers are NOT provided to initialization functions.

If these pointers are provided, what is this directory used for ?

Reply
0 Kudos
7 Replies
rahqa
VMware Employee
VMware Employee

the tmpdir which usually falls in C:\Documents and Settings\"

A definition (location) of the config file is not mentioned in the guide, so my assumption is you would need to manually create one and point to the same on your code. but i am again not very sure.

Reply
0 Kudos
giladb
Contributor
Contributor

Thanks, but that wasn't exactly my question.

Initially when working with VDDK I saw logs written into tmpdir.

Now that I have my log functions set up, the logs go to my functions and it seems like nothing is written to the tmpdir.

What can I expect to actually be written in this directory ?

Reply
0 Kudos
rahqa
VMware Employee
VMware Employee

Sorry, if i'd missed that. But as i said before, there isn't a pre-defined thing within VDDK code that asks the logging to be happening in the tmpdir. Thats defined when you provide the init() statement, right? (by specifying the config file parameter)

So, if you have provided your own log functions, then by default, the only logs you may expect to find in the temp dir are the regular VMware logs / VC logs etc. Again thats what i am assuming looking at the guide, i agree there isn't a complete explanation on this given. But when i look into the location of the temp folder i do see logs with name vmware-.log, which are mostly VC related logs. Is that the case?

Reply
0 Kudos
giladb
Contributor
Contributor

No, that's not the case.

I am using VDDK within a commercial product which will run in a customer environment for an unknown period of time.

I need information that will help me make decisions such as

- What disk space would be needed over time for the directory ?

- What kind of cleanup (e.g. logrotate) can I perform on the directory ?

- What files might provide useful information when troubleshooting a customer problem ?

Like you, I have also read the documentation and could not find answers.

I am hoping someone from VMware could provide some useful answers

Reply
0 Kudos
admin
Immortal
Immortal

tmpdir is used for creating redo logs and to create temporary registry hives in some cases. VMware programs might also create additional files for internal purposes, but usually these are cleaned up (.

It is difficult to predict what space should be reserved for this (it would depend on how big the system or software hive is for example) - but I have never seen a software hive that is > 100MB, so may be that is a good starting point.

You should be able to delete these files as part of startup before initializing vixDiskLib.

Hope that helps,

Sudarsan

giladb
Contributor
Contributor

A few more clarifications

- AFAIK registry hives are read by VDDK only when code runs on Windows machines. Mine runs on Linux. Does that mean I will not see these files ?

- As part of periodic cleanups, can I remove from the directory files older than X days ? What X would be reasonable ?

Reply
0 Kudos
admin
Immortal
Immortal

You won't see these files on Linux. Perhaps rather than X days, an upper limit may be more apt ?

On Linux, this directory is used to create partition mount points. Of course, you should not delete them while stuff is mounted.

Thanks

Sudarsan