Skip to content

Disable delete on primary NIC when other NICs present #2652

Description

@taspelund

When you go to delete the Primary NIC of an instance, you are given an error if there are other (secondary) NICs attached:
Image

It would be nice to improve this workflow a bit so a user does the right thing without encountering an error to learn what the right thing to do is.

@internet-diglett had the idea to gray out the Delete button on the Primary NIC and have a hover message to the effect of "Cannot delete the Primary NIC while other NICs are present. You must promote another NIC to Primary before deleting this one."

Activity

  1. taspelund commented on Jan 14, 2025

    @taspelund
    Author

    Similar ticket: #1987

  2. david-crespo commented on Jan 14, 2025

    @david-crespo
    Collaborator

    Disabling delete with a message sounds good, that's the pattern we like. I don't think we were aware that this could happen.

  3. added this to the 13 milestone on Jan 14, 2025
  4. changed the title [-]Improve NIC deletion/promotion workflow[/-] [+]Disable delete on primary NIC when other NICs present[/+] on Jan 14, 2025
  5. benjaminleonard commented on Jan 21, 2025

    @benjaminleonard
    Contributor

    I think we should consider moving away from situations where a user is stopped in their tracks and just help them do the pre-requisite action first. Can we instead within the confirm delete modal, tell the user that by deleting this NIC, some other NIC will be promoted automatically?

    I do also find the error message here a little confusing. Can you delete the NIC if it's the only one there. It's just you cannot have some NICs without at least one being promoted to the primary NIC first?

  6. david-crespo commented on Jan 21, 2025

    @david-crespo
    Collaborator

    Yeah, I was planning on looking at the API logic.

  7. modified the milestones: 13, Unscheduled on Jan 27, 2025
  8. internet-diglett commented on Jan 29, 2025

    @internet-diglett

    I think we should consider moving away from situations where a user is stopped in their tracks and just help them do the pre-requisite action first. Can we instead within the confirm delete modal, tell the user that by deleting this NIC, some other NIC will be promoted automatically?

    @benjaminleonard I think this was being discussed in the networking channel, but I think the reason we didn't suggest this option was because in cases where there are more than 2 nics the logic for which nic should be promoted is unclear, and if the wrong nic is auto-promoted we are causing the customer to do the same amount of work anyway.

    If the message says "you must promote another nic to primary before deleting this one," is the customer really stopped in their tracks when they are being instructed on what steps to take in the same interface they are already viewing?

    Leaning towards your suggestion, if we want to use a delete modal to handle this interaction, is it possible to prompt them with a selection to the effect of "please select which NIC you want to promote to primary"? I think maybe this would be the least "surprising" outcome and also gets us what we want?

    I do also find the error message here a little confusing. Can you delete the NIC if it's the only one there. It's just you cannot have some NICs without at least one being promoted to the primary NIC first?

    I wonder if the error message is accurately conveying our intended message. I think the intended effect is that there is always at least one primary nic?

  9. bnaecker commented on Jan 29, 2025

    @bnaecker
    Contributor

    I do also find the error message here a little confusing. Can you delete the NIC if it's the only one there. It's just you cannot have some NICs without at least one being promoted to the primary NIC first?

    I wonder if the error message is accurately conveying our intended message. I think the intended effect is that there is always at least one primary nic?

    There is always zero or one primary NIC. There may zero or more secondary NICs (up to 7 today), but only if there is already a primary. The primary NIC is where we attach all the external networking state, like external addresses, and the VPC information like routes, subnet information, internet gateways, etc.

    You may delete any secondary NIC. You may delete the primary NIC only if it's the only NIC (there are no secondary NICs). That's because we need a place to attach that external state -- if you delete a primary, we can only make an unambiguous choice of which secondary to promote if there is zero or one secondary NIC. Instead of trying to decide, and possibly getting it wrong, the user needs to pick.

    I think the idea of making it easier to handle through the UI is good. Improving the error message is good. Using a modal to help the user select a secondary to promote while they're deleting the primary is good too. We could also try to handle on the server the case of deleting a primary when there's exactly one secondary, and auto-promoting that secondary, but I do worry a bit that special-casing it makes things less predictable from a user's standpoint. However, I think the only thing we should not do is try to pick a secondary NIC for them automatically when there is more than one choice available.

  10. modified the milestones: Unscheduled, 15 on Apr 24, 2025
  11. charliepark commented on May 21, 2025

    @charliepark
    Contributor

    Closed with #2806, though we can revisit some of the suggested enhancements (adding a modal to select an alternate NIC, etc.) down the road as needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions