-
Notifications
You must be signed in to change notification settings - Fork 254
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
Unify Device and VirtualMachine in a single table. Differentiate between the 2 using is_virtual
flag.
#1178
Comments
Just 2 cents: Interfaces and VMInterfaces needs to be consolidated as well, then |
@sirtux Oh absolutely, that would definitely need to be a part of this as well. A few random thoughts:
|
I like this! It's in line with our previous workflows, ones we could not easily transfer to Nautobot. |
@jedelman8 @glennmatthews related to this, and before opening a new issue, I would like to ask if you think that following this path,
Even the |
Has there been any movement on this? We're quite keen to see it implemented |
It was not committed for 2.0. Highly likely for 3.0. Until then, what is preventing you from using Device to track VMs today? |
Discussed in #1015
Originally posted by slappey-ibkr October 19, 2021
Environment
Proposed Functionality
Add
is_virtual
flag to Device model and deprecate VirtualMachine or make it a proxy model back to Device withis_virtual
hardcoded to True. I know there's more to it than that but I'd love to hear everyone's thoughts on this.Use Case
The problem with having 2 tables is that we must know if a host is physical or virtual when running remote jobs. Otherwise, we have to query both tables until we find the host we’re looking for. We must also know if a host is a physical or virtual when creating relations to objects such as IPAddress. The proposed functionality would unify all devices in a single table.
Database Changes
is_virtual
flag to Deviceis_virtual
hardcoded to True.is_virtual
hardcoded to False.if device.is_virtual == False:
if device.is_virtual == True:
Example Queries
device_count = Device.objects.filter(is_virtual=False).count()
vm_count = Device.objects.filter(is_virtual=True).count()
cluster = Cluster.objects.first()
cluster_devices = cluster.devices.filter(is_virtual=False)
cluster_vms = cluster.devices.filter(is_virtual=True)
External Dependencies
None
Again, I know there's more to it than this but I'd love to kick off the conversation and hear everyone's thoughts.
The text was updated successfully, but these errors were encountered: