Advanced Settings

621 views
Skip to first unread message

Babie

unread,
Apr 26, 2012, 2:02:47 PM4/26/12
to pysphere
I would like to know how to set the value for
isolation.tools.diskWiper.disable=TRUE and
isolation.tools.diskShrink.disable=TRUE in order to prevent the
virtual disk shrinking with the help of pysphere.

May I know the API that I can use?

Seba

unread,
Apr 27, 2012, 9:13:58 AM4/27/12
to pysp...@googlegroups.com, Babie
Hi Babie,

   I can't find those properties on the vSphere API reference (http://pubs.vmware.com/vsphere-50/index.jsp?topic=/com.vmware.wssdk.apiref.doc_50/right-pane.html)
   They might not be available from the vSphere SDK. I'll ask the VMWare guys though.
   Have you been able to set those settings from the VI Client tool?

Regards,

Seba.


2012/4/26 Babie

pmalla

unread,
Apr 30, 2012, 3:12:26 PM4/30/12
to pysp...@googlegroups.com, Babie
Thank you for looking into it. 

When I had googled, this what I got from http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1010941. But I have not tried with the vi client. I am building a vSphere manager with the help of pysphere module so, I am wondering what would be the API or piece of code to achieve the same.

To disable disk shrink for a virtual machine:  
  1. Power off the virtual machine. Do not skip this step.
  2. Remove the virtual machine from the inventory.
  3. Edit the virtual machine's .vmx file and add the following lines:

    isolation.tools.diskWiper.disable = "TRUE"
    isolation.tools.diskShrink.disable = "TRUE"

    Note: For more information about editing a .vmx file, see Tips for editing a .vmx file (1714).
     
  4. Re-add the virtual machine to the inventory.
  5. Power on the virtual machine.

Seba

unread,
May 3, 2012, 8:46:39 AM5/3/12
to pysp...@googlegroups.com, pmalla
Hi,

I've posted this discussion on the vmware vSphere SDK community: http://communities.vmware.com/thread/400625

If there's a correct way to do that they'll know, if not I guess we can use the API to get the .vmx file, modify it, and re upload it with those changes (but that's not a very "clean" alternative).
   
I'll keep you posted.

Regards,


Seba.

2012/4/30 pmalla

Seba

unread,
May 7, 2012, 9:12:09 AM5/7/12
to pysp...@googlegroups.com, pmalla
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.


2012/5/3 Seba <arg...@gmail.com>

Ganesh Satpute

unread,
Jul 30, 2015, 3:20:24 AM7/30/15
to pysphere, mjs...@gmail.com, arg...@gmail.com
Hi Seba,

Is there any way to delete/remove these advanced settings?

Thanks & Regards,
Ganesh.
Reply all
Reply to author
Forward
0 new messages