community.vmware icon indicating copy to clipboard operation
community.vmware copied to clipboard

community.vmware.vmware_guest_cross_vc_clone - Cannot find destination folder

Open B3LL3-PSH opened this issue 4 years ago • 2 comments

SUMMARY

I try to clone template across vCenter using community.vmware.vmware_guest_cross_vc_clone in order to replace previous template in destination vCenter with latest one from source vCenter.

But always get error "msg": "Destination folder does not exist. Please refer to the documentation to correctly specify the folder."

To confirm that I input correct folder/format in this module, I use vmware_guest_find in order to get destination folder for previous template in destination vCenter then register into variable and use that defined variable in community.vmware.vmware_guest_cross_vc_clone

ISSUE TYPE
  • Bug Report
COMPONENT NAME

community.vmware.vmware_guest_cross_vc_clone

ANSIBLE VERSION
2.9 with installed collection community.vmware 
COLLECTION VERSION
community.vmware
CONFIGURATION

OS / ENVIRONMENT

VMware vCenter 6.5

STEPS TO REPRODUCE
- name: Find folder path of destination VC
  vmware_guest_find:
    hostname: 172.x.x.112
    username: {{xxx}}
    password: {{xxx}}
    validate_certs: no
    name: xxxxxxxxxxxxxxxxxx
  delegate_to: localhost
  register: destinationfolder

- set_fact:
    dest_folder: "{{ destinationfolder.folders[0] }}"

- name: clone a new refresh template across VC
  community.vmware.vmware_guest_cross_vc_clone:
    hostname: 172.x.x.111
    username: {{xxx}}
    password: {{xxx}}
    validate_certs: no
    name: Windows2K19_Template
    destination_vm_name: xxxxxxxxxxxxxxxxxx
    destination_vcenter: 172.x.x.112
    destination_vcenter_username: {{xxx}}
    destination_vcenter_password: {{xxx}}
    destination_vcenter_validate_certs: no
    destination_host: xxxxxx
    destination_datastore: xxxxx
    destination_vm_folder: '{{ dest_folder }}'
    state: present
  register: cross_vc_clone_from_template
  delegate_to: localhost
EXPECTED RESULTS

Template is cloned to destination vCenter

ACTUAL RESULTS

Got message below: "msg": "Destination folder does not exist. Please refer to the documentation to correctly specify the folder.",


**vmware_guest_find**
"folders": [
        "/xxxxx/xx/xxxx"

**set_fact**
"dest_folder": "/xxxxx/xx/xxxx"

**community.vmware.vmware_guest_cross_vc_clone**
    "msg": "Destination folder does not exist. Please refer to the documentation to correctly specify the folder.",
    "invocation": {
        "module_args": {
            "hostname": "172.x.x.111",
            "username": "xxxxxxx",
            "password": "xxxxxxx",
            "validate_certs": false,
            "name": "xxxxxxx",
            "destination_vm_name": "xxxxxxx",
            "destination_vcenter": "172.x.x.112",
            "destination_vcenter_username": "xxxxxxx",
            "destination_vcenter_password": "xxxxxxx",
            "destination_vcenter_validate_certs": false,
            "destination_host": "xxxxxxx",
            "destination_datastore": "xxxxxxx",
            "destination_vm_folder": "/xxxxx/xx/xxxx",
            "state": "present",
            "port": xx,
            "use_instance_uuid": false,
            "destination_vcenter_port": xx,
            "proxy_host": null,
            "proxy_port": null,
            "uuid": null,
            "moid": null,
            "destination_resource_pool": null
        }
    },
    "_ansible_no_log": false,
    "changed": false,
    "_ansible_delegated_vars": {
        "ansible_host": "localhost"
    }

B3LL3-PSH avatar Sep 07 '21 09:09 B3LL3-PSH

Files identified in the description: None

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

ansibullbot avatar Sep 07 '21 09:09 ansibullbot

Hi.. I'm also suffering from this problem,

The module can't take any absolute path. If I set a folder, then it finds one. Problem is that I have multiple folders with the same name so an absolute path is required.

magnusolsson80 avatar May 31 '22 14:05 magnusolsson80