VMware

This Question is Answered

6 Replies Last post: Jul 3, 2009 1:57 PM by lamw  

Fault Tolerance: automatic schedule / scripting posted: Jun 20, 2009 2:20 PM

Click to view blondie72's profile Novice 5 posts since
Jun 20, 2009

Hi NG,

we would like to enable/disable FT on a VM by scheduled task or scripting on CLI (cronjob).

Is this possible at all, if so how?

Regards

Click to view AndreTheGiant's profile Guru 5,897 posts since
Aug 28, 2008
Actually you cannot use "scheduled task" feature in vCenter Server.
I think that the only way is use PowerShell or other script language.

Andre
Click to view lamw's profile Champion 2,803 posts since
Nov 27, 2007
There are no default CLI utilities that support this right off the bat but you can take a look at using vSphere SDK for Perl or PowerCLI to accomplish this task.

Take a look at EnableSecondaryVM_Task() to enable FT and DisableSecondaryVM_Task() to disable FT. If you provide the credentials either through a config file or hardcode it within the script, then you can setup a Windows scheduled task to enable/disable FT, but you won't be able to schedule this within vCenter itself. You can also set the script run via a cronjob if you're using a UNIX/Linux or even vMA to execute the script.

If I get some free cycles this week, perhaps I'll write up a quick Perl script to show how this is done, but the methods are pretty straight forward and so long as you have the appropriate license for FT.


=========================================================================
William Lam
VMware vExpert 2009
VMware ESX/ESXi scripts and resources at: http://engineering.ucsb.edu/~duonglt/vmware/
vGhetto Script Repository
VMware Code Central - Scripts/Sample code for Developers and Administrators
http://twitter.com/lamw

http://engineering.ucsb.edu/~duonglt/vmware/vexpert_silver_icon.jpg

If you find this information useful, please award points for "correct" or "helpful".

Re: Fault Tolerance: automatic schedule / scripting

3. Jul 3, 2009 8:50 AM in response to: lamw
Click to view Texiwill's profile Guru 10,205 posts since
Jan 13, 2004
Click to view lamw's profile Champion 2,803 posts since
Nov 27, 2007
Take a look at this script: http://www.yellow-bricks.com/2009/07/01/ftcli-pl-vmware-fault-tolerant-managment/

=========================================================================
William Lam
VMware vExpert 2009
VMware ESX/ESXi scripts and resources at: http://engineering.ucsb.edu/~duonglt/vmware/
vGhetto Script Repository
VMware Code Central - Scripts/Sample code for Developers and Administrators
http://twitter.com/lamw

http://engineering.ucsb.edu/~duonglt/vmware/vexpert_silver_icon.jpg

If you find this information useful, please award points for "correct" or "helpful".

Click to view lamw's profile Champion 2,803 posts since
Nov 27, 2007
np. Let me know how testing goes.

=========================================================================
William Lam
VMware vExpert 2009
VMware ESX/ESXi scripts and resources at: http://engineering.ucsb.edu/~duonglt/vmware/
vGhetto Script Repository
VMware Code Central - Scripts/Sample code for Developers and Administrators
http://twitter.com/lamw

http://engineering.ucsb.edu/~duonglt/vmware/vexpert_silver_icon.jpg

If you find this information useful, please award points for "correct" or "helpful".

VMware Developer

SDKs, APIs, Videos, Learn and much more in the Developer community.

Learn More

Developer Sample Code

Increase your developer productivity with VMware API sample code.

Learn More

VMworld Sessions & Labs

Online access to the latest VMworld Sessions & Labs and online services.

Learn more

Purchase PSO Credits Online

Purchase credits to redeem training and consulting services online.

Buy Now

Community Hardware Software

View reported configurations or report your own.

Learn More

VMware vSphere

Come witness the next giant leap in virtualization.

Register Today

Communities