Skip to content

Commit

Permalink
Stop deleting chelsio addresses during uninstall (#2953)
Browse files Browse the repository at this point in the history
## Before this PR

Running on rack2 and calling `omicron-package uninstall` would involve a
fatal termination of the connection, as it would delete the `cxgbe0/ll`
and `cxgbe1/ll` IP addresses necessary for contacting the sled.

## After this PR

Those addresses are left alone. This is pretty useful for development,
as it allows us to run `uninstall` to cleanly wipe a Gimlet, preparing
it for future "clean installs".
  • Loading branch information
smklein authored Apr 30, 2023
1 parent 9f31e37 commit 261b9cc
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions sled-hardware/src/cleanup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
use anyhow::Error;
use futures::stream::{self, StreamExt, TryStreamExt};
use illumos_utils::dladm::Dladm;
use illumos_utils::dladm::BOOTSTRAP_ETHERSTUB_NAME;
use illumos_utils::dladm::BOOTSTRAP_ETHERSTUB_VNIC_NAME;
use illumos_utils::dladm::UNDERLAY_ETHERSTUB_NAME;
use illumos_utils::dladm::UNDERLAY_ETHERSTUB_VNIC_NAME;
use illumos_utils::dladm::{Dladm, VnicSource};
use illumos_utils::link::LinkKind;
use illumos_utils::opte;
use illumos_utils::zone::IPADM;
Expand All @@ -30,14 +30,6 @@ pub fn delete_bootstrap_addresses(log: &Logger) -> Result<(), Error> {
delete_addresses_matching_prefixes(log, &[bootstrap_prefix])
}

fn delete_chelsio_addresses(log: &Logger) -> Result<(), Error> {
let prefixes = crate::underlay::find_chelsio_links()?
.into_iter()
.map(|link| format!("{}/", link.name()))
.collect::<Vec<_>>();
delete_addresses_matching_prefixes(log, &prefixes)
}

fn delete_addresses_matching_prefixes(
log: &Logger,
prefixes: &[String],
Expand Down Expand Up @@ -112,7 +104,6 @@ pub async fn delete_omicron_vnics(log: &Logger) -> Result<(), Error> {
pub async fn cleanup_networking_resources(log: &Logger) -> Result<(), Error> {
delete_underlay_addresses(log)?;
delete_bootstrap_addresses(log)?;
delete_chelsio_addresses(log)?;
delete_omicron_vnics(log).await?;
delete_etherstub(log)?;
opte::delete_all_xde_devices(log)?;
Expand Down

0 comments on commit 261b9cc

Please sign in to comment.