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

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

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

Some starter reading that might help
:

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