# Vmware VM is created with a default template sometime the drive letter parameter gets drifted.

**URL:** <https://forum.ansible.com/t/vmware-vm-is-created-with-a-default-template-sometime-the-drive-letter-parameter-gets-drifted/38361>\
**Category:** Ansible Project\
**Tags:** vmware\
**Created:** [August 23, 2023, 10:40am UTC](https://forum.ansible.com/t/vmware-vm-is-created-with-a-default-template-sometime-the-drive-letter-parameter-gets-drifted/38361 "2023-08-23T10:40:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deepak\_B\_K](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/deepak_b_k/32/5151_2.png) [@Deepak\_B\_K](https://forum.ansible.com/u/Deepak_B_K)\
**Post date:** [August 23, 2023, 10:40am UTC](https://forum.ansible.com/t/vmware-vm-is-created-with-a-default-template-sometime-the-drive-letter-parameter-gets-drifted/38361/1 "2023-08-23T10:40:59Z")

</div>

Hi Team,

I have a strange issue while add disk to my vm image and I using the community vmware\_guest\_disk . when vm is created with a default template sometime the drive letter parameter is drifted.  
example /dev/sdb is created instead /dev/sda.

Please find my code below.

name: “Add disk for VM: {{ vm\_name }}”  
community.vmware.vmware\_guest\_disk:  
hostname: “{{ vmware.hostname }}”  
username: “{{ vmware.username }}”  
password: “{{ vmware.password }}”  
validate\_certs: “{{ vmware.validate\_certs }}”  
datacenter: “{{ vmware\_env.datacenter }}”  
moid: ‘{{ vm\_info.id }}’  
disk:

- size\_kb: “{{ (vm\_disk.disk\_capacity / 1024)|int }}”  
type: “{{ vmware.storage\_provisioning | default(‘thick’) }}”  
datastore: “{{ vmware\_env.datastore }}”  
state: present  
controller\_type: “{{ vm\_disk.disk\_type | lower }}”  
controller\_number: 0  
unit\_number: 1  
delegate\_to: “{{ delegation\_host }}”

I appreciate your suggestion on this issue.

Thanks  
Deepak Kumar

---

<div class="post-metadata">

**Author:** ![Will\_McDonald](https://avatars.discourse-cdn.com/v4/letter/w/f475e1/32.png) [@Will\_McDonald](https://forum.ansible.com/u/Will_McDonald)\
**Post date:** [August 23, 2023, 11:03am UTC](https://forum.ansible.com/t/vmware-vm-is-created-with-a-default-template-sometime-the-drive-letter-parameter-gets-drifted/38361/2 "2023-08-23T11:03:11Z")

</div>

This isn’t necessarily an Ansible problem, but more likely to just be consistent device enumeration.

Some starter reading that might help  
:

- [https://kb.vmware.com/s/article/2048497](https://kb.vmware.com/s/article/2048497)
- [https://kb.vmware.com/s/article/2091560](https://kb.vmware.com/s/article/2091560)
- [https://access.redhat.com/documentation/en-us/red\_hat\_enterprise\_linux/7/html/storage\_administration\_guide/persistent\_naming](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/storage_administration_guide/persistent_naming)
- [https://wiki.debian.org/Persistent\_disk\_names](https://wiki.debian.org/Persistent_disk_names)
- [https://wiki.debian.org/udev](https://wiki.debian.org/udev)

---

<div class="post-metadata">

**Author:** ![Deepak\_B\_K](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/deepak_b_k/32/5151_2.png) [@Deepak\_B\_K](https://forum.ansible.com/u/Deepak_B_K)\
**Post date:** [August 24, 2023, 10:44am UTC](https://forum.ansible.com/t/vmware-vm-is-created-with-a-default-template-sometime-the-drive-letter-parameter-gets-drifted/38361/3 "2023-08-24T10:44:55Z")

</div>

Hi Will,

Thank you for the valuable link it is helping us in the understand the problem . As right said its not ansible issue but the Vmware consistent device enumeration.

Regards,  
Deepak Kumar
