vsphere/nas_datastore_helper.go
func (p *nasDatastoreMountProcessor) processUnmountOperations() error {
	hosts := p.diffOldNew()
	if len(hosts) < 1 || p.ds == nil {
		// Nothing to do
		return nil
	}
	for _, hsID := range hosts {
		dss, err := hostDatastoreSystemFromHostSystemID(p.client, hsID)
		if err != nil {
			return fmt.Errorf("host %q: %s", hostsystem.NameOrID(p.client, hsID), err)
		}
		if err := removeDatastore(dss, p.ds); err != nil {
			return fmt.Errorf("host %q: %s", hostsystem.NameOrID(p.client, hsID), err)
		}
	}
	return nil
}
func (p *nasDatastoreMountProcessor) processUnmountOperations() error {
	hosts := p.diffOldNew()
	if len(hosts) < 1 || p.ds == nil {
		// Nothing to do
		return nil
	}
	for _, hsID := range hosts {
		dss, err := hostDatastoreSystemFromHostSystemID(p.client, hsID)
		if err != nil {
			return fmt.Errorf("host %q: %s", hostsystem.NameOrID(p.client, hsID), err)
		}
		if err := removeDatastore(dss, p.ds); err != nil {
			return fmt.Errorf("host %q: %s", hostsystem.NameOrID(p.client, hsID), err)
		}
	}
	return nil
}
// processUnmountOperations processes all pending unmount operations by diffing old
// and new and removing any hosts that were not found in new. This operation
// only proceeds if the datastore field in the processor is populated.