Hi,
The guys from vmware replied. I've just added a method to pysphere (revision 72) to easily set this settings. For the moment you can create new settings or modify existing ones, but I don't know yet how to remove an existing setting.
Since revision 72, you can do this:
> vm = server.get_vm_by_path("[datasotre] path/to/config.vmx")
> config = {'isolation.tools.diskWiper.disable':'TRUE', 'isolation.tools.diskShrink.disable':'TRUE'}
> vm.set_extra_settings(config)
i.e. you hace to call set_extra_settings on a VM object and pass a dictionary where key-values are the options you want to set/change
If you are using the stable version 0.1.6 or below, you can achieve the same results this way:
==========================================
from pysphere import VIServer
from pysphere.resources import VimService_services as VI
s = VIServer()
s.connect("server", "user", "password")
vm = s.get_vm_by_path("[datastore1] Windows XP Home Edition/Windows XP Home Edition - SP3.vmx")
def add_extra_config(vm, config):
request = VI.ReconfigVM_TaskRequestMsg()
_this = request.new__this(vm._mor)
_this.set_attribute_type(vm._mor.get_attribute_type())
request.set_element__this(_this)
spec = request.new_spec()
extra_config = []
for k,v in config.iteritems():
ec = spec.new_extraConfig()
ec.set_element_key(str(k))
ec.set_element_value(str(v))
extra_config.append(ec)
spec.set_element_extraConfig(extra_config)
request.set_element_spec(spec)
s._proxy.ReconfigVM_Task(request)
add_extra_config(vm, {'isolation.tools.diskWiper.disable':'', 'isolation.tools.diskShrink.disable':''})
s.disconnect()
Regards!
Seba.