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

8.0.0.1 breaks Ansible vmware_content_deploy_ovf_template folder lookup #995

Closed
MallocArray opened this issue Nov 29, 2022 · 4 comments
Closed
Assignees
Labels

Comments

@MallocArray
Copy link

Describe the bug

After installing pyvmomi 8.0.0.1 and then using the Ansible module community.vmware.vmware_content_deploy_ovf_template to deploy a template, it begins failing with an error such as:
Failed to find the folder /vm/Special_Permissions/Linux

Downgrading pyvmomi to 7.0.3 with the same Ansible and vCenter configuration is successful.

Tried adding a trailing slash to the folder parameter with no luck.

Reproduction steps

        - name: Create VM from Content Library
          community.vmware.vmware_content_deploy_ovf_template:
            hostname: "{{ vcenter }}"
            username: "{{ vcenter_user }}"
            password: "{{ vcenter_password }}"
            validate_certs: "{{ vmware_validate_certs }}"
            datacenter: "{{ vcenter_datacenter }}"
            cluster: "{{ vcenter_cluster }}"
            datastore: "{{ datastore.Name }}"
            folder: "{{ vcenter_vm_folder }}"
            name: "{{ computername }}"
            library: "{{ content_library | default(omit) }}"
            ovf_template: "{{ vcenter_os_template | regex_search('[\\w-]*$') }}"
            storage_provisioning: "{{ storage_provisioning | default(omit) }}"
          delegate_to: localhost

Example variable value I'm passing as the folder:
vcenter_vm_folder: vm/Special_Permissions/Linux/
3.
...

Expected behavior

Expect the Ansible module to interact with both 7.0.3 and 8.0.0.1 similarly

Additional context

No response

@q84fh
Copy link

q84fh commented Dec 1, 2022

Hi, we observed the same behavior while trying to use community.vmware.vmware_content_deploy_ovf_template.
Thanks for a workaround with downgrade, it worked!

@mariolenz
Copy link

As far as I can see, the problem is that the childType of a folder is a list of object types ([vim.Folder, vim.VirtualMachine, vim.VirtualApp]) while in pyVmomi < 8.0.0.1 it is a list of strings (['Folder', 'VirtualMachine', 'VirtualApp']).

According to the documentation, childType is an array of strings.

At least, this is what I think.

@DanielDraganov DanielDraganov self-assigned this Dec 2, 2022
@DanielDraganov
Copy link
Collaborator

This is an unwanted behavior change and there is an ongoing investigation how to restore the previous behavior.
We will update you once there's a clear resolution.

@DanielDraganov
Copy link
Collaborator

@mariolenz This should be fixed now.
87d4cb3

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

No branches or pull requests

4 participants