Being a diligent admin, I always unmount a datastore from an ESXi server prior to completely deleting it. It's a good way to verify the datastore isn't being used before the storage admin removes the ESXi server's visibility to the lun. This is a task that I really want to perform in vRealize Orchestrator (vRO) instead of having to unmount the datastore from the ESXi server manually. SPOILER ALERT - I'll include a workflow that allows you to execute the unmount across multiple ESXi servers in parallel at the end of this post. The first step is to see what's available from an unmount standpoint. We start by bringing up the API Explorer under the Tools menu. From here we can search the "Attributes & methods" for text that contains the word unmount. There quite a few methods which contain the text unmount. I'm going to focus on the VcHostStorageSystem.unmountVmfsVolume() method. This method takes a single argument - the uuid of
We recently needed to re-ip our vCenter servers; each with ~200 ESXi servers which needed to be reconnected - thank goodness for PowerCLI. Since there isn't a "Reconnect-VMHost" cmdlet provided by PowerCLI we needed to check the HostSystem Object at h ttps://www.vmware.com/support/developer/converter-sdk/conv55_apireference/vim.HostSystem.html and to see what methods were available (hint: there's a ReconnectHost_Task method which will do the trick). We can still leverage the "Get-VMHost" cmdlet to return the disconnected ESXi servers and then call the ReconnectHost_Task method to reconnect each ESXi server. The code is fairly short: Get-VMHost -state Disconnected | foreach-object { $vmhost = $_ $connectSpec = New-Object VMware.Vim.HostConnectSpec $connectSpec.force = $true $connectSpec.hostName = $vmhost .name $connectSpec.userName = 'root' $connectSpec.password = 'MySecretPassword' $vmhost .extensionData.Reconnec