Skip to content

vmware_guest create/delete VM in another folder #1090

Open
@Krioks

Description

@Krioks
SUMMARY

I have the following virtual machine structure:
└───Project
    ├───aaa1
    ├───aaa111
    │               test1
    └───aaa1111

And when I want to create a virtual machine with name test1 in the aaa1 folder, I get the following problem:
The virtual machine is created (customized) in the aaa111 folder, instead of the aaa1 folder.

Another problem:
When I try to delete the test1 machine from the aaa1 folder, I will delete it from the aaa111 folder.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

community.vmware.vmware_guest
ansible-collections/community.vmware/blob/main/plugins/module/vmware_guest.py

ANSIBLE VERSION
4.5.0
COLLECTION VERSION
1.12.0
ADDITIONAL INFORMATION

I guess the problem lies in the function of getting the virtual machine.
community\vmware\plugins\module_utils\vmware.py

https://github.com/ansible-collections/community.vmware/blob/main/plugins/module_utils/vmware.py#L1266

The main problem is that user_desired_path lies entirely in actual_vm_folder_path:
user_desired_path = 'Project / aaa1'
actual_vm_folder_path = 'Project / aaa11'

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue/PR relates to a bugneeds_infoThis issue requires further information. Please answer any outstanding questionsneeds_templateThis issue/PR has an incomplete description. Please fill in the proposed template correctlyneeds_triageNeeds a first human triage before being processed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions