ansible-collections / community.vmware

Ansible Collection for VMware
GNU General Public License v3.0
348 stars 335 forks source link

Consistently receiving "500 - Internal Server Error" errors when using vsphere_copy #2069

Open robbinscp opened 4 months ago

robbinscp commented 4 months ago
SUMMARY

Consistently receiving "500 - Internal Server Error" errors when using vsphere_copy

ISSUE TYPE
COMPONENT NAME

vsphere_copy

ANSIBLE VERSION
ansible [core 2.15.1]
  config file = None
  configured module search path = ['/Users/robbinsc/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/robbinsc/Library/Python/3.9/lib/python/site-packages/ansible
  ansible collection location = /Users/robbinsc/.ansible/collections:/usr/share/ansible/collections
  executable location = /Users/robbinsc/Library/Python/3.9/bin/ansible
  python version = 3.9.6 (default, Feb  3 2024, 15:58:27) [Clang 15.0.0 (clang-1500.3.9.4)] (/Library/Developer/CommandLineTools/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True
COLLECTION VERSION
Collection       Version
---------------- -------
community.vmware 3.7.0  
CONFIGURATION
ansible-config dump --only-changed
CONFIG_FILE() = None
OS / ENVIRONMENT

I am attempting to upload ISOs to a vSphere 8 environment (8.0.2.00300). This has failed irrespective of the platform used (Mac / Linux / WSL).

STEPS TO REPRODUCE

Example playbook shown below

  - name: upload Windows ISO
    when: iso_exists.state == "absent"
    vsphere_copy:
      hostname: "{{ vsphere_hostname }}"
      username: "{{ vsphere_username }}"
      password: "{{ vsphere_password }}"
      datacenter: "{{ vsphere_datacenter }}"
      datastore: "{{ vsphere_iso_datastore }}"
      src: "{{ iso_image}}.iso"
      path: "{{ vsphere_iso_directory }}/{{  iso_image }}.iso"
      timeout: 360
      validate_certs: false
      delegate_to: localhost
EXPECTED RESULTS

The copy/upload of ISO completes to the datastore successfully

ACTUAL RESULTS

The copy/upload fails as shown below

fatal: [test-win10 -> localhost]: FAILED! => {
    "changed": false,
    "errno": null,
    "headers": {
        "connection": "close",
        "content-length": "37",
        "content-security-policy": "upgrade-insecure-requests",
        "content-type": "text/plain; charset=utf-8",
        "date": "Sat, 11 May 2024 22:39:36 GMT",
        "set-cookie": "vmware_soap_session=\"9a259e138970d9406a0c037a88d3aa8858c725c3\"; Path=/; HttpOnly; Secure;",
        "strict-transport-security": "max-age=31536000",
        "x-content-type-options": "nosniff",
        "x-envoy-upstream-service-time": "30030",
        "x-frame-options": "DENY",
        "x-xss-protection": "1"
    },
    "invocation": {
        "module_args": {
            "datacenter": "Datacenter",
            "datastore": "datastore",
            "host": "SANITIZED",
            "hostname": "SANITIZED",
            "password": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
            "path": "iso/Win10_21H1_English_x64.iso-no-prompt.iso",
            "state": "file",
            "timeout": 600,
            "username": "administrator@vsphere.local",
            "validate_certs": false
        }
    },
    "msg": "Failed to query for file 'iso/Win10_21H1_English_x64.iso-no-prompt.iso'",
    "path": "iso/Win10_21H1_English_x64.iso-no-prompt.iso",
    "reason": "Internal Server Error",
    "size": null,
    "state": "file",
    "status": 500,
    "url": "https://SANITIZED/folder/iso/Win10_21H1_English_x64.iso-no-prompt.iso?dsName=datastore&dcPath=Datacenter"
}
...ignoring
ihumster commented 4 months ago

@robbinscp Typically, such errors are a consequence of a problem on the server side (in your case, vCenter Server). Have you tried copying the same operation with the same file to the same datastore via vSphere Client?