ManageIQ / manageiq

ManageIQ Open-Source Management Platform
https://manageiq.org
Apache License 2.0
1.35k stars 898 forks source link

[RFE] Allow assigning a purpose to a network interface #19548

Closed ghost closed 4 years ago

ghost commented 4 years ago

I would be good to be able to assign purposes to network interfaces, both on hosts and virtual machines. I already have two use cases in mind:

  1. Ansible playbook - Use a specific NIC to connect to the managed object when running an Ansible playbook. This would prevent failure for managed objects with more than one NIC, given that the used IP address is the first one in the list of NICs. It would complement https://github.com/ManageIQ/manageiq/issues/19501.
  2. VM Migration - Use the most appropriate (fastest, dedicated, ...) to transfer the disks. By default, we use the administration network which is probably the one we don't want to use, as it can have an impact on the platform stability.

We have many options:

  1. Add the "acts_as_miq_taggable" extension to the GuestDevice class.
  2. Tag a specific virtual switch, i.e. Switch class, as it is already taggable.

For VM Migration use case, if no NIC/switch is tagged as migration or if the host has no IP address on the NIC/switch (acts as a bridge), then we would default to the admin IP address.

This would then require some UI work, because the GuestDevice or Switch classes are exposed in a limited way in CloudForms UI. We could also have a table widget where all hosts would be displayed, with a dropdown to select the purpose.

RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1749313

agrare commented 4 years ago

:+1: for adding tagging to guest-devices. I don't think we can generally identify a "purpose" for a NIC so allowing user to tag them would seem to be the best option.

given that the used IP address is the first one in the list of NICs.

Can you elaborate on this? We should ideally link IP addresses to their NIC so multiple NICs shouldn't be an issue

ghost commented 4 years ago

given that the used IP address is the first one in the list of NICs.

Can you elaborate on this? We should ideally link IP addresses to their NIC so multiple NICs shouldn't be an issue

I'm talking about the choice of IP address for the conversion host, because we have no way to know which one to use: https://github.com/ManageIQ/manageiq/blob/master/app/models/conversion_host.rb#L135-L138.

And that is the same for the pre/post migration playbooks: we use the first IP address of the VM: https://github.com/ManageIQ/manageiq/blob/master/app/models/infra_conversion_job.rb#L295.

With tags, we can at least force a specific NIC, and the associated IP address.

The other concern is to identify if we should use IPv4 or IPv6... In topological inventory, I noticed that there is a ipaddresses table: https://github.com/RedHatInsights/topological_inventory-core/blob/master/db/schema.rb#L403. Have you planned to backport this in ManageIQ model ?

ghost commented 4 years ago

@agrare for consistency in the tagging taxonomy, what would you recommend as category name? Is purpose fine?

miq-bot commented 4 years ago

This issue has been automatically marked as stale because it has not been updated for at least 3 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

Thank you for all your contributions! More information about the ManageIQ triage process can be found in the traige process documentation.

gtanzillo commented 4 years ago

Ping @fdupont-redhat Is this still an issue now that tagging has been enabled?

ghost commented 4 years ago

With tagging, I think we're covering the initial requirement. Closing.