Today I had an experience that was not very different than some of the ‘I was today years old’ memes which are floating on the web. I was working on a script to detach a LUN on all hosts within a cluster when I stumbled on a contribution from LucD in the VMware Technology Network.

Now I already knew the vSphere Web Services API had a method to detach a LUN (DetachScsiLun), but was unaware of a variant that will run asynchronously (DetachScsiLunEx_Task). The latter being of course much faster. This led me to browse the API reference documentation and found that there are actually more methods with the Ex_Task suffix.

MethodManaged ObjectSince

As you can see from the table above some of these methods have been around for quite a while. And the list has grown over time.

For my purposes the DetachScsiLunEx_Task and UnmountVmfsVolumeEx_Task are the most useful. But there are of course more use cases, like this post from vcloudvision co-author Bryan which used esxcli but could just as easily used the MarkPerenniallyReservedEx_Task method.

One thing to note is that when using running tasks asynchronously you need to approach error handling differently. But if you monitor the progress in vCenter like I do for most batch operations you’ll be fine.

For more information on the above mentioned methods, head on over to the API reference for the vSphere Web Services API on

I hope that this finding is of use to you too. Happy multitasking!

Rudolf Kleijwegt

I am an experienced IT professional with over 20 years of hands-on experience designing, deploying, and maintaining IT infrastructure in both enterprise and service provider environments. My skills span across Linux and Windows and a multitude of server applications, allowing me to excel in a wide range of IT roles. Currently, my primary focus is on Software Defined DataCenter and DevOps. I am passionate about staying up to date with the latest trends in the industry to achieve superior outcomes.


Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *