<!--- Verify first that your issue is not already reported on GitHub -->
<!--- Also test if the latest release and devel branch are affected too -->
<!--- Complete *all* sections as described, this form is processed automatically -->

##### SUMMARY

Two vmware modules uses `copy()` to duplicate an internal instance of a pyvmomi object. This to be able to modify the object during an iteration.

- https://github.com/ansible/ansible/blob/622a493ae03bd5e5cf517d336fc426e9d12208c7/lib/ansible/modules/cloud/vmware/vmware_guest.py#L788
- https://github.com/ansible/ansible/blob/622a493ae03bd5e5cf517d336fc426e9d12208c7/lib/ansible/modules/cloud/vmware/vmware_datastore_facts.py#L220

As explain here, https://github.com/ansible/ansible/pull/60196/files#r312643761 this is not the best approach and this may impact the performance.

##### ISSUE TYPE
- Bug Report

##### COMPONENT NAME

vmware

##### ANSIBLE VERSION
<!--- Paste verbatim output from "ansible --version" between quotes -->
```paste below
devel
```
if 'hardware' in self.params:
            if 'num_cpus' in self.params['hardware']:
                try:
                    num_cpus = int(self.params['hardware']['num_cpus'])
                except ValueError:
                    self.module.fail_json(msg="hardware.num_cpus attribute should be an integer value.")
                
                if vm_obj and vm_obj.runtime.powerState == vim.VirtualMachinePowerState.poweredOn:
                    if not vm_obj.config.cpuHotRemoveEnabled and num_cpus < vm_obj.config.hardware.numCPU:
                        self.module.fail_json(msg="Configured cpu number is less than the cpu number of the VM, "
                                                  "cpuHotRemove is not enabled")
                    if not vm_obj.config.cpuHotAddEnabled and num_cpus > vm_obj.config.hardware.numCPU:
                        self.module.fail_json(msg="Configured cpu number is more than the cpu number of the VM, "
                                                  "cpuHotAdd is not enabled")
                if 'num_cpu_cores_per_socket' in self.params['hardware']:
                    try:
                        num_cpu_cores_per_socket = int(self.params['hardware']['num_cpu_cores_per_socket'])
                    except ValueError:
                        self.module.fail_json(msg="hardware.num_cpu_cores_per_socket attribute "
                                                  "should be an integer value.")
                    if num_cpus % num_cpu_cores_per_socket != 0:
                        self.module.fail_json(msg="hardware.num_cpus attribute should be a multiple "
                                                  "of hardware.num_cpu_cores_per_socket")
                    self.configspec.numCoresPerSocket = num_cpu_cores_per_socket
                    if vm_obj is None or self.configspec.numCoresPerSocket != vm_obj.config.hardware.numCoresPerSocket:
                        self.change_detected = True
                self.configspec.numCPUs = num_cpus
                if vm_obj is None or self.configspec.numCPUs != vm_obj.config.hardware.numCPU: