VMware {code} Community
rickyelqasem
Enthusiast
Enthusiast

vmx settings

Anyway to get at the advanced vmx settings programmatically through the SDK?

Parameters like:

isolation.tools.diskWiper.disable=TRUE

I need c# example

Ricky El-Qasem VCI/VCP - MCSE - RHCT
Reply
0 Kudos
2 Replies
Steve_Jin
Expert
Expert

I just blogged about it today. Check it out here:

http://www.doublecloud.org/2011/01/how-to-change-vmx-programmatically/

Good luck!

Steve Jin, author of VMware VI and vSphere SDK (Prentice Hall), creator of VI Java API

Steve JIN Author of VMware VI and vSphere SDK; Creator of open source VI Java API (http://vijava.sf.net); Blogger at http://www.doublecloud.org
Reply
0 Kudos
rickyelqasem
Enthusiast
Enthusiast

I worked it out in c#

//#############add settings to vmx file##############################

ManagedObjectReference moref = new ManagedObjectReference();

moref.type = "VirtualMachine";

moref.Value = "vm-697";

VirtualMachineConfigSpec vmconfig = new VirtualMachineConfigSpec();

OptionValue opt = new OptionValue();

opt.key = "isolation.tools.diskWiper.disable";

opt.value = "TRUE";

vmconfig.extraConfig = new OptionValue[1];

vmconfig.extraConfig[0] = opt;

vmconfig.name = "Herc-Test";

_service.ReconfigVM_Task(moref, vmconfig);

//################################################################

Ricky El-Qasem VCI/VCP - MCSE - RHCT
Reply
0 Kudos