-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] Add VM and Machine Tags to IPs and NICs #297
Comments
Hi, so far i'm not aware that IP addresses are objects in vmware where we can grab it from. |
The IPs associated to the VM are already pulled out of the vsphere vcenter alongside with all NICs and other hardware. In module/sources/vmware/connection.py Line 2242 you iterate over the IPs associated to vm nics and add them to the collection of nic_ips which you add to the inventory in 2364. |
It sounds like you know how to retrieve the data, I would be quite happy a PR. |
I might have misunderstood your question. So you would like to assign the same tags which were retrieved from the vCenter for the Host/VM to the IP and network interfaces? is that correct? Adding tags should not be that big of a deal but if an IP moves it is quite difficult to remove the old tags from the previous machine as the relation is already lost. what do you think? |
Yes, correct. The IP shall receive the tags from its machine.
Moving and Reassigning an IP is not a problem because your script does 2 steps:
1. Delete the IP from the old NIC - delete the machine tags from the NBIPaddress object here before orphaning (orphaned-tags will be set anyway) if added by configuration
2. add the IP to the new machine along with the tags.
|
This is unfortunately not easy to realise as it seems. It depends in which order the vCenter lists the VMs. What would be your approach? |
Hey, just wanted to check if this is still relevant and if so, do you have an approach how to solve the described issue? |
For an automation purpose it would be quite convinient to add Tags from vphere VMs to IPs attached to them to specify for example DEV- and PROD-Environments, Customers etc.
The Sourcecode explicitly forbits importing tags for other objects than machines, clusters, folders and so on. Is it possible to enlarge configuration options with options like "ip_tag_source = object, vm" etc?
;cluster_tag_source =
;host_tag_source =
;vm_tag_source =
The text was updated successfully, but these errors were encountered: