diff --git a/changelogs/fragments/1321-vmware_vm_info-allocaded_storag_cpu_memory_output.yaml b/changelogs/fragments/1321-vmware_vm_info-allocaded_storag_cpu_memory_output.yaml new file mode 100644 index 000000000..30492e10a --- /dev/null +++ b/changelogs/fragments/1321-vmware_vm_info-allocaded_storag_cpu_memory_output.yaml @@ -0,0 +1,3 @@ +bugfixes: + - vmware_guest_disk - Ignore datastores in maintenance mode + (https://github.com/ansible-collections/community.vmware/pull/1321). diff --git a/plugins/modules/vmware_guest_disk.py b/plugins/modules/vmware_guest_disk.py index 011deac3b..91958924b 100644 --- a/plugins/modules/vmware_guest_disk.py +++ b/plugins/modules/vmware_guest_disk.py @@ -1044,6 +1044,8 @@ def get_recommended_datastore(self, datastore_cluster_obj, disk_spec_obj): datastore = None datastore_freespace = 0 for ds in datastore_cluster_obj.childEntity: + if ds.summary.maintenanceMode == "inMaintenance": + continue if ds.summary.freeSpace > datastore_freespace: # If datastore field is provided, filter destination datastores datastore = ds