diff --git a/changelogs/fragments/1751-autoselect_datastore-also-use-NFS-mounts.yml b/changelogs/fragments/1751-autoselect_datastore-also-use-NFS-mounts.yml new file mode 100644 index 000000000..21bd754af --- /dev/null +++ b/changelogs/fragments/1751-autoselect_datastore-also-use-NFS-mounts.yml @@ -0,0 +1,2 @@ +minor_changes: + - autoselect_datastore - add support to also look at NFS mounted filesystems (previously was just VMFS) diff --git a/plugins/modules/vmware_guest.py b/plugins/modules/vmware_guest.py index 16dcb301c..51e4aba1f 100644 --- a/plugins/modules/vmware_guest.py +++ b/plugins/modules/vmware_guest.py @@ -2739,13 +2739,13 @@ def select_datastore(self, vm_obj=None): for host in cluster.host: for mi in host.configManager.storageSystem.fileSystemVolumeInfo.mountInfo: - if mi.volume.type == "VMFS": + if mi.volume.type == "VMFS" or mi.volume.type == "NFS": datastores.append(self.cache.find_obj(self.content, [vim.Datastore], mi.volume.name)) elif self.params['esxi_hostname']: host = self.find_hostsystem_by_name(self.params['esxi_hostname']) for mi in host.configManager.storageSystem.fileSystemVolumeInfo.mountInfo: - if mi.volume.type == "VMFS": + if mi.volume.type == "VMFS" or mi.volume.type == "NFS": datastores.append(self.cache.find_obj(self.content, [vim.Datastore], mi.volume.name)) else: datastores = self.cache.get_all_objs(self.content, [vim.Datastore])