VMware vSphere

 View Only

OS Customization spec not naming machine correctly

  • 1.  OS Customization spec not naming machine correctly

    Posted Mar 27, 2025 05:35 AM
    Edited by Hans Meiser Mar 27, 2025 07:46 AM

    VCenter 7.0.3 Build:24322018

    Hello,

    we have a powershell script and clone a template into new machines using VCenter API. As Parameter we use VM-Name "aabbcc". This part works fine. 
    After cloning a VM Customization Specification is used to add VM to AD and DNS. this works in most cases.
    In OS Customization spec we use option:

    Computer name: Use Virtual Machine name

    In 2 cases we got a vm in vcenter called "aabbcc" but hostname and dns-name are set to "aabbcc-0", so it appends a suffix -0. this indicates that VCenter already found a vm/host with that name and used an alternative, but i cant find and hint into this direction.
    For this section we reuse VM-Names, Hostnames and DNS-names again and again which works in most cases, but with 2 names we have this problem. i can not find the reason for this. Before every deploment VCenter, AD, DNS is cleaned from old name. there is no such Name in use any more and it works in most cases except 2 cases.
    What can else be the reason for this? Is there a log where VCenter writes out why i decided to use this suffix for names?
    Thank you,
    Hans