Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

1 Answer 1

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:

scsi0:0.mode="independent-persistent"

or

scsi0:0.mode="persistent"

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

or

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 vmware.com/go/powercli –  Kai Aug 13 '09 at 14:08
add comment

Your Answer

 
discard

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.