Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a pool of virtual machines running in ESX that have their virtual hard drives set to Indenpendant/Non-Persistent mode. I won't go into the reasons for this other than to say it is working really well for us. Periodically I need to reset these settings back to the standard persistent mode and would like to automate that via a scheduled task for script. Does anyone know how to do this?

share|improve this question

Each VM has a corresponding .vmx file that holds its configuration information. You would need to modify this file for the specific VM(s) and add/modify one of the following lines, depending on which configuration you want to set:




Changes will take effect after the guest is rebooted.

Another way, if you use the VI Toolkit via Powershell, this will be much easier by running one of the following commands:

Get-Harddisk -VM MachineName| Set-HardDisk -Persistence IndependentPersistent


Get-Harddisk -VM MachineName| Set-HardDisk -Persistence NonPersistent

The latter can be scheduled to run via batch or straight PoSH script from within Windows. As far as scheduling the modification of the flat file in Linux, I'm not sure, I'm a Windows guy. I'm hoping someone else can fill you in on that.

I hope I pointed you in the right direction.

share|improve this answer
Looks like VI Toolkit was renamed to vSphere PowerCLI. See – Kai Aug 13 '09 at 14:08

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.