We want to mount/unmount datastore and attach/detatchLUN in vCenter with help of vCO workflows.
For unmounting datastore and detatching LUNs I found a scripting methods unmountvmfsvolume(), detachScsiLun() respectively.
Are these correct methods? If yes, these methods accept lunuuid and vmfsuuid as a parameter. From where I can get these parameters?
try to use ONYX (labs.vmware.com/flings/onyx) to figure out the proper API methods tasks you do manually via the vSphere Client.
For the ids: See this thread, and the linked discussions there, the storageSystem attribute of the host configuration should bring you to the needed information.
To detach a storage device using the vSphere client: