Open TimHarmon opened 3 years ago
@TimHarmon Thanks for reporting this issue. Could you please paste the full path of parent folder?
I am not able to reproduce this error for path like
# govc find /
...
/Asia-Datacenter1/vm/prod
/Asia-Datacenter1/vm/prod/tier1
/Asia-Datacenter1/vm/prod/tier1/tier2
/Asia-Datacenter1/vm/prod/tier1/tier2/tier3
...
and playbook
- name: Delete tier3 folder
vcenter_folder:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
validate_certs: no
datacenter: Asia-Datacenter1
folder_name: tier3
parent_folder: prod/tier1/tier2
folder_type: vm
state: absent
@TimHarmon Thanks for reporting this issue. Could you please paste the full path of parent folder?
I am not able to reproduce this error for path like
# govc find / ... /Asia-Datacenter1/vm/prod /Asia-Datacenter1/vm/prod/tier1 /Asia-Datacenter1/vm/prod/tier1/tier2 /Asia-Datacenter1/vm/prod/tier1/tier2/tier3 ...
and playbook
- name: Delete tier3 folder vcenter_folder: hostname: '{{ vcenter_hostname }}' username: '{{ vcenter_username }}' password: '{{ vcenter_password }}' validate_certs: no datacenter: Asia-Datacenter1 folder_name: tier3 parent_folder: prod/tier1/tier2 folder_type: vm state: absent
@Akasurde, the full path I am using is /CISG-NJLAB/vm/Deployment_Environments/DP_LAB_H_v455/
@TimHarmon Are you using the latest version of vcenter_folder from the collection?
# ansible-galaxy collection list | grep vmware
community.vmware 1.3.0
...
~Also, I added a feature to identify parent folder using MoID - https://github.com/ansible-collections/community.vmware/pull/464~
~You can use the following playbook with PR #464~
@TimHarmon Could you please run the following playbook and let me know the output?
- name: Get all folders
community.vmware.vmware_folder_info:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
validate_certs: no
datacenter: '{{ datacenter_name }}'
register: v
- debug:
msg: "{{ v.folder_info }}"
will do as soon as I can.
On Wed, Nov 11, 2020 at 9:52 PM Abhijeet Kasurde notifications@github.com wrote:
@TimHarmon https://github.com/TimHarmon Could you please run the following playbook and let me know the output?
name: Get all folders community.vmware.vmware_folder_info: hostname: '{{ vcenter_hostname }}' username: '{{ vcenter_username }}' password: '{{ vcenter_password }}' validate_certs: no datacenter: '{{ datacenter_name }}' register: v
debug: msg: "{{ v.folder_info }}"
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ansible-collections/community.vmware/issues/458#issuecomment-725854836, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEAGCC46JFZVAFZ3ZZADDU3SPNZYNANCNFSM4S3TOSXA .
cc @Tomorrow9 @goneri @lparkes @meerkampdvv @pgbidkar @warthog9 click here for bot help
Hi,
I've run into this today. Has any workaround been found?
Hey team, Seems to be that parent_folder can't take several levels, it works for me using only one folder, ansible vmware community 1.12.0 and vcenter 6.7 and ansible 2.9.20. Thanks, Damian
I'm hitting on this bug as well. Can't create a simple folder.
- name: test
hosts: localhost
gather_facts: false
vars_files: vars.yml
tasks:
- name: Main folder
vcenter_folder:
hostname: "{{ vcenter_host }}"
username: "{{ vcenter_username }}"
password: "{{ vcenter_password }}"
validate_certs: false
datacenter: "{{ vcenter_datacenter }}"
parent_folder: "/datacenter1/vm/"
folder_name: "TESTFOLDER"
folder_type: vm
state: present
For parent folder, i've tried: /datacenter1 datacenter1/ /datacenter1/ /datacenter1/vm /datacenter1/vm/ vm /vm vm/
Nothing works. Always fatal: [localhost]: FAILED! => {"changed": false, "msg": "Could not find folder FOO/whatever i choose
EDIT: The respective output from folder_info:
"vmFolders": { "moid": "group-v1002", "path": "/datacenter1/vm",
So the folder does exist.
SOLUTION: It does work if deleting the option "parent_folder" and mantaining only "folder_type: vm", then it creates the folder in root dir. On this case /datacenter1/vm/NEWFOLDER
SUMMARY
When executing a vcenter_folder task using a long folder name as parent folder "nested" "Deployment_Environments/DP_LAB_H" ansible returns a parent folder does not exist. I have tried including the datacenter and VM and changing Deployment Environments to Deployment_Environments".
ISSUE TYPE
COMPONENT NAME
vcenter_folder
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
esx 6.7, vcenter 6.7
STEPS TO REPRODUCE
EXPECTED RESULTS
folder removal
ACTUAL RESULTS
failure due to folder not present result