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 }}
Repository navigation
Disable delete on primary NIC when other NICs present #2652
When you go to delete the Primary NIC of an instance, you are given an error if there are other (secondary) NICs attached:
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."
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?
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?
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.
Activity
taspelund commentedon Jan 14, 2025
Similar ticket: #1987
david-crespo commentedon Jan 14, 2025
Disabling delete with a message sounds good, that's the pattern we like. I don't think we were aware that this could happen.
[-]Improve NIC deletion/promotion workflow[/-][+]Disable delete on primary NIC when other NICs present[/+]benjaminleonard commentedon Jan 21, 2025
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?
david-crespo commentedon Jan 21, 2025
Yeah, I was planning on looking at the API logic.
internet-diglett commentedon Jan 29, 2025
@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 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?
bnaecker commentedon Jan 29, 2025
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.
charliepark commentedon May 21, 2025
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.