Creating datastore using devicepath

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Creating datastore using devicepath

Arvind
I get errors while trying to query the VMFS datastore options. Below is the code i am using which is throwing an error.

def createDatastore(si, uuid):
    dp="/vmfs/devices/disks/"+ str(uuid)
    print "Device path: %s" %dp
    try:
        vmfs_ds_options = vim.host.DatastoreSystem.QueryVmfsDatastoreCreateOptions(devicePath=dp)
    except vim.fault.NotFound:
        print "Not found"
    except vim.fault.HostConfigFault:
        print "host config fault"
    except vmodl.fault.NotSupported:
        print "Not supported"
    except Exception as e:
        print ("Unexpected error: %s" %e)

    else:
        print "Query success"



# python dd_esx_disk.py -s 10.25.190.100 -u root -p Abcd123! --uuid eui.3221784b198087db8ccb707400000001
Device path: /vmfs/devices/disks/eui.3221784b198087db8ccb707400000001
Unexpected error: _InvokeMethod() takes at least 2 arguments (1 given)


From the documentation here (https://github.com/vmware/pyvmomi/blob/master/docs/vim/host/DatastoreSystem.rst#id7), the function takes only 2 arguments and the second is optional.  I get the same error if add the vmfsMajorVersion argument to the function. Am i missing something ?

thanks