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

Create overwrites a VM of same name even when the folder is different #43161

Closed
japplewhite opened this issue Jul 23, 2018 · 15 comments
Closed
Labels
affects_2.5 This issue/PR affects Ansible v2.5 bug This issue/PR relates to a bug. cloud has_pr This issue has an associated PR. module This issue/PR relates to a module. needs_info This issue requires further information. Please answer any outstanding questions. support:community This issue/PR relates to code supported by the Ansible community. vmware VMware community

Comments

@japplewhite
Copy link

SUMMARY

Create overwrites a VM of same name even when the folder is different

ISSUE TYPE
  • Bug Report
COMPONENT NAME

vmware_guest

ANSIBLE VERSION
ansible 2.5.3
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Apr 11 2018, 07:36:10) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]
CONFIGURATION

RETRY_FILES_ENABLED(/etc/ansible/ansible.cfg) = False

OS / ENVIRONMENT

cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)

STEPS TO REPRODUCE

create some VMs
create a new DC folder in vCenter
use the module to create VMs of same name
result: vms in another folder are overwritten when they should not be

EXPECTED RESULTS
ACTUAL RESULTS

@ansibot
Copy link
Contributor

ansibot commented Jul 23, 2018

Files identified in the description:

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

@ansibot
Copy link
Contributor

ansibot commented Jul 23, 2018

@ansibot
Copy link
Contributor

ansibot commented Jul 23, 2018

Hi japplewhite,

Thank you for the issue, just so you are aware we have a dedicated Working Group for vmware.
You can find other people interested in this in #ansible-vmware on Freenode IRC
For more information about communities, meetings and agendas see https://github.com/ansible/community

click here for bot help

@ansibot ansibot added affects_2.5 This issue/PR affects Ansible v2.5 bug This issue/PR relates to a bug. cloud module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:community This issue/PR relates to code supported by the Ansible community. vmware VMware community labels Jul 23, 2018
@Akasurde
Copy link
Member

@japplewhite Thanks for reporting this issue. Are you changing value of folder variable in playbook after creating the folder ? It would be easy to debug if you could paste playbook(s) and console output -vvvv

needs_info

@ansibot ansibot added needs_info This issue requires further information. Please answer any outstanding questions. and removed needs_triage Needs a first human triage before being processed. labels Jul 24, 2018
@japplewhite
Copy link
Author

@Akasurde yes I found this issue because I had VMs of the same name residing in a different folder and they were removed/overwritten

@ansibot ansibot removed the needs_info This issue requires further information. Please answer any outstanding questions. label Aug 1, 2018
@Akasurde
Copy link
Member

Akasurde commented Aug 2, 2018

Could you please paste the playbooks used ?

@japplewhite
Copy link
Author

japplewhite commented Aug 2, 2018


- hosts: localhost
   vars:
    host1: {name: 'infra-0', ip: '172.63.186.231', memory: '8192'}
    host2: {name: 'infra-1', ip: '172.63.186.232', memory: '8192'}
    host3: {name: 'infra-2', ip: '172.63.186.233', memory: '8192'}
    host4: {name: 'app-0', ip: '172.63.186.234', memory: '8192'}
    host5: {name: 'app-1', ip: '172.63.186.235', memory: '8192'}
    host6: {name: 'app-2', ip: '172.63.186.236', memory: '8192'}
    host7: {name: 'master-0', ip: '172.63.186.237', memory: '16384'}
    host8: {name: 'master-1', ip: '172.63.186.238', memory: '16384'}
    host9: {name: 'master-2', ip: '172.63.186.239', memory: '16384'}
    host10: {name: 'haproxy-0', ip: '172.63.186.240', memory: '2048'}
    
  gather_facts: "no"
  connection: local

  tasks:
    - name: Create Openshift cluster VMs
      vmware_guest:
        hostname: 172.63.184.230
        username: CIE\ajeffrey
        password: password123
        validate_certs: "no"
        datacenter: CIE-DC
        folder: /CIE-DC/vm/ajeffrey/openshift
        cluster: CIE-Infrastructure
        name: "{{ item.name }}"
        state: poweredon
        template: ocp_template_master
        networks:
          - name: 172_CIE_VLAN
            ip: "{{ item.ip }}"
            netmask: 255.255.255.0
            gateway: 172.63.186.1
            dns_servers:
              - 172.63.184.251
              - 172.63.186.245
            domain: example.local
          - name: MGMT-Network
        disk:
          - size_gb: 60
            type: thin
            datastore: Test_VMs_Datastore
          - size_gb: 40
            type: thin
            datastore: Test_VMs_Datastore
          - size_gb: 40
            type: thin
            datastore: Test_VMs_Datastore
          - size_gb: 40
            type: thin
            datastore: Test_VMs_Datastore
        hardware:
          memory_mb: "{{ item.memory }}"
          num_cpus: 2
          num_cpu_cores_per_socket: 1
          scsi: paravirtual
        customization:
          password: password123
      loop:
        - "{{ host1 }}"
        - "{{ host2 }}"
        - "{{ host3 }}"
        - "{{ host4 }}"
        - "{{ host5 }}"
        - "{{ host6 }}"
        - "{{ host7 }}"
        - "{{ host8 }}"
        - "{{ host9 }}"
        - "{{ host10 }}"
      delegate_to: localhost```

@ansibot ansibot added support:core This issue/PR relates to code supported by the Ansible Engineering Team. and removed support:community This issue/PR relates to code supported by the Ansible community. labels Sep 19, 2018
@ansibot ansibot added support:community This issue/PR relates to code supported by the Ansible community. and removed support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Oct 5, 2018
@ansibot
Copy link
Contributor

ansibot commented Nov 25, 2018

cc @ckotte
click here for bot help

@ansibot
Copy link
Contributor

ansibot commented Feb 17, 2019

@ansibot
Copy link
Contributor

ansibot commented Feb 25, 2019

@ansibot
Copy link
Contributor

ansibot commented May 8, 2019

cc @goneri
click here for bot help

@ansibot
Copy link
Contributor

ansibot commented Jun 1, 2019

@Akasurde
Copy link
Member

resolved_by_pr #65922

@Akasurde
Copy link
Member

@japplewhite, Could you please check PR #65922 and let us know if it works for you ?

Please check How to test a PR for more help.

Thanks.

needs_info

@ansibot ansibot added the has_pr This issue has an associated PR. label Dec 19, 2019
@ansibot ansibot added the needs_info This issue requires further information. Please answer any outstanding questions. label Dec 19, 2019
@Akasurde
Copy link
Member

Closing this issue since PR #65922 is merged. Please feel free to open a new issue if problem persists.

@ansible ansible locked and limited conversation to collaborators Jan 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.5 This issue/PR affects Ansible v2.5 bug This issue/PR relates to a bug. cloud has_pr This issue has an associated PR. module This issue/PR relates to a module. needs_info This issue requires further information. Please answer any outstanding questions. support:community This issue/PR relates to code supported by the Ansible community. vmware VMware community
Projects
None yet
Development

No branches or pull requests

3 participants