You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 2, 2018. It is now read-only.
We have some VMs that have an operating system hostname that is not unique, which was causing them to not be provisioned properly into Netbox. I made the following workaround to have all VMs named by their VM name and not the guest host name.
Line 192:
Old: $Hostname = $Guest.Hostname.ToLower()
New: $Hostname = $VM.Name.ToLower()
The text was updated successfully, but these errors were encountered:
mmahacek
changed the title
Issue with non-unique host names
Sync-vmware Issue with non-unique host names
Sep 21, 2018
Netbox forces unique names for all VM objects, and this script intentionally canonicalizes to the OS hostname when it can be determined (lines 196-204). I understand the issue you're encountering, but I'm kind of anticipating that most people will adapt this script to their own environments. In particular, this is not the version of the script that I use in our organization because I insert a lot of organization-specific logic into our version. So I'm inclined to say that the current logic is fine and your use case is specific to your environment. Does that make sense?
With that said, I could understand adding in some logic to handle getting around the uniqueness requirement, e.g. if you've cloned a machine or are recovering from a Veeam backup. Do you have a suggestion for how you want to handle the case of another machine with the same hostname? When does that arise? Is it better simply to mirror the VM inventory name? I personally like the network hostname from in-guest, but I could see the other way as well.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
We have some VMs that have an operating system hostname that is not unique, which was causing them to not be provisioned properly into Netbox. I made the following workaround to have all VMs named by their VM name and not the guest host name.
Line 192:
Old: $Hostname = $Guest.Hostname.ToLower()
New: $Hostname = $VM.Name.ToLower()
The text was updated successfully, but these errors were encountered: