I am using a script to deploy a VM with OS Customizations. It all works splendidly except for one thing: the VM name doesn't match the assigned hostname in the OS. The VM name could be "Test" and the hostname will be "Test-0". It always seems to append a "-0" (dash zero) on the end of the name of the VM for the hostname in Linux (haven't tried Windows to know if I have the same results).
Here is the line I use for the customization:
$VMspec = New-OSCustomizationSpec -OSType "Linux" -Type Persistent -Name "$VMName-spec" -DnsServer "$VMDNS" -DnsSuffix "$VMSuffix" -NamingScheme Vm -Domain "$VMDomain"
If I read this correctly, the "-NamingScheme Vm" should set the hostname to the same as the VM. It should use the VM name, and append a number only if there is another VM of the same name, but there isn't -- it doesn't matter what the VM name is (I've tried some pretty bizarre ones), they always add the -0 to the hostname in the guest Linux OS.
Has anyone seen this before? Any ideas what I'm missing?
Thanks.