Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vsphere_copy :- Unable to copy files from local to Datacenter under folder #2206

Open
Srikanth-HS opened this issue Oct 17, 2024 · 0 comments

Comments

@Srikanth-HS
Copy link

SUMMARY

When trying to upload file from local to data store by using below ansible snippet

  • name: Upload build iso to vSphere
    community.vmware.vsphere_copy:
    hostname: 'domain.com'
    username: 'CODE1*'
    password: '
    *'
    src: '/servers/README.md'
    datacenter: 'Cap America'
    datastore: 'Store-Silver-01'
    path: "/Folder1/README.md"
    validate_certs: False
    timeout: 300
    delegate_to: localhost
ISSUE TYPE
  • Bug Report
    Getting below error
    The full traceback is:
    File "/tmp/ansible_community.vmware.vsphere_copy_payload_sdozi01a/ansible_community.vmware.vsphere_copy_payload.zip/ansible_collections/community/vmware/plugins/modules/vsphere_copy.py", line 172, in main
    r = open_url(url, data=data, headers=headers, method='PUT', timeout=timeout,
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/ansible_community.vmware.vsphere_copy_payload_sdozi01a/ansible_community.vmware.vsphere_copy_payload.zip/ansible/module_utils/urls.py", line 1686, in open_url
    return Request().open(method, url, data=data, headers=headers, use_proxy=use_proxy,
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/tmp/ansible_community.vmware.vsphere_copy_payload_sdozi01a/ansible_community.vmware.vsphere_copy_payload.zip/ansible/module_utils/urls.py", line 1578, in open
    r = urllib_request.urlopen(request, None, timeout)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib64/python3.12/urllib/request.py", line 215, in urlopen
    return opener.open(url, data, timeout)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib64/python3.12/urllib/request.py", line 521, in open
    response = meth(req, response)
    ^^^^^^^^^^^^^^^^^^^
    File "/usr/lib64/python3.12/urllib/request.py", line 630, in http_response
    response = self.parent.error(
    ^^^^^^^^^^^^^^^^^^
    File "/usr/lib64/python3.12/urllib/request.py", line 559, in error
    return self._call_chain(*args)
    ^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib64/python3.12/urllib/request.py", line 492, in _call_chain
    result = func(*args)
    ^^^^^^^^^^^
    File "/usr/lib64/python3.12/urllib/request.py", line 639, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
    fatal: [localhost]: FAILED! => changed=false
    invocation:
    module_args:
    datacenter: Cap America
    datastore: Store-Silver-01
    hostname: domain.com
    password: VALUE_SPECIFIED_IN_NO_LOG_PARAMETER
    path: /Folder1/README.md
    port: 443
    proxy_host: null
    proxy_port: null
    src: /servers/README.md
    timeout: 300
    username: CODE1\ing07471
    validate_certs: false
    msg: 'HTTP Error 404: Not Found'

NO MORE HOSTS LEFT ******************************************************************************************************************************************

PLAY RECAP **************************************************************************************************************************************************
localhost : ok=5 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0

COMPONENT NAME

community.vmware.vsphere_copy:

ANSIBLE VERSION

ansible [core 2.16.3]
  config file = /actions-runner/_work/iap-pb-spm/iap-pb-spm/build/OVA/ansible.cfg
  configured module search path = ['/home/ing07471/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/ing07471/.local/lib/python3.12/site-packages/ansible
  ansible collection location = /home/ing07471/.ansible/collections:/usr/share/ansible/collections
  executable location = /home/ing07471/.local/bin/ansible
  python version = 3.12.5 (main, Aug 26 2024, 10:40:21) [GCC 8.5.0 20210514 (Red Hat 8.5.0-22)] (/usr/bin/python3.12)
  jinja version = 3.1.4
  libyaml = True

COLLECTION VERSION
Collection         Version
------------------ -------
cloud.common       4.0.0
community.general  9.5.0
community.vmware   3.3.0
vmware.vmware      1.5.0
vmware.vmware_rest 4.1.0

CONFIGURATION

OS / ENVIRONMENT

RHEL 8

STEPS TO REPRODUCE

Suspect in Datacenter name with Space

EXPECTED RESULTS
ACTUAL RESULTS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant