33// file, You can obtain one at https://mozilla.org/MPL/2.0/.
44
55use camino:: Utf8PathBuf ;
6- use illumos_utils:: dladm:: EtherstubVnic ;
76use illumos_utils:: zpool:: PathInPool ;
87use key_manager:: StorageKeyRequester ;
98use nexus_sled_agent_shared:: inventory:: InventoryDataset ;
@@ -14,10 +13,12 @@ use omicron_common::disk::DatasetName;
1413use omicron_common:: disk:: DiskIdentity ;
1514use sled_agent_api:: ArtifactConfig ;
1615use sled_storage:: config:: MountConfig ;
16+ use sled_storage:: disk:: Disk ;
1717use sled_storage:: manager:: NestedDatasetConfig ;
1818use sled_storage:: manager:: NestedDatasetListOptions ;
1919use sled_storage:: manager:: NestedDatasetLocation ;
2020use slog:: Logger ;
21+ use std:: collections:: HashSet ;
2122use std:: sync:: Arc ;
2223use std:: sync:: OnceLock ;
2324use tokio:: sync:: watch;
@@ -45,6 +46,7 @@ use crate::SledAgentFacilities;
4546use crate :: TimeSyncStatus ;
4647use crate :: dataset_serialization_task:: DatasetTaskHandle ;
4748use crate :: dataset_serialization_task:: NestedDatasetMountError ;
49+ use crate :: dump_setup_task;
4850use crate :: internal_disks:: InternalDisksReceiver ;
4951use crate :: ledger:: LedgerTaskHandle ;
5052use crate :: raw_disks;
@@ -68,6 +70,7 @@ pub struct ConfigReconcilerSpawnToken {
6870 time_sync_config : TimeSyncConfig ,
6971 reconciler_result_tx : watch:: Sender < ReconcilerResult > ,
7072 currently_managed_zpools_tx : watch:: Sender < Arc < CurrentlyManagedZpools > > ,
73+ external_disks_tx : watch:: Sender < HashSet < Disk > > ,
7174 ledger_task_log : Logger ,
7275 reconciler_task_log : Logger ,
7376}
@@ -111,6 +114,16 @@ impl ConfigReconcilerHandle {
111114 base_log,
112115 ) ;
113116
117+ // Spawn the task that manages dump devices.
118+ let ( external_disks_tx, external_disks_rx) =
119+ watch:: channel ( HashSet :: new ( ) ) ;
120+ dump_setup_task:: spawn (
121+ internal_disks_rx. clone ( ) ,
122+ external_disks_rx,
123+ Arc :: clone ( & mount_config) ,
124+ base_log,
125+ ) ;
126+
114127 let ( reconciler_result_tx, reconciler_result_rx) =
115128 watch:: channel ( ReconcilerResult :: default ( ) ) ;
116129 let ( currently_managed_zpools_tx, currently_managed_zpools_rx) =
@@ -142,6 +155,7 @@ impl ConfigReconcilerHandle {
142155 time_sync_config,
143156 reconciler_result_tx,
144157 currently_managed_zpools_tx,
158+ external_disks_tx,
145159 ledger_task_log : base_log
146160 . new ( slog:: o!( "component" => "SledConfigLedgerTask" ) ) ,
147161 reconciler_task_log : base_log
@@ -164,7 +178,6 @@ impl ConfigReconcilerHandle {
164178 U : SledAgentArtifactStore ,
165179 > (
166180 & self ,
167- underlay_vnic : EtherstubVnic ,
168181 sled_agent_facilities : T ,
169182 sled_agent_artifact_store : U ,
170183 token : ConfigReconcilerSpawnToken ,
@@ -174,6 +187,7 @@ impl ConfigReconcilerHandle {
174187 time_sync_config,
175188 reconciler_result_tx,
176189 currently_managed_zpools_tx,
190+ external_disks_tx,
177191 ledger_task_log,
178192 reconciler_task_log,
179193 } = token;
@@ -198,12 +212,13 @@ impl ConfigReconcilerHandle {
198212 }
199213
200214 reconciler_task:: spawn (
215+ Arc :: clone ( self . internal_disks_rx . mount_config ( ) ) ,
201216 key_requester,
202217 time_sync_config,
203- underlay_vnic,
204218 current_config_rx,
205219 reconciler_result_tx,
206220 currently_managed_zpools_tx,
221+ external_disks_tx,
207222 sled_agent_facilities,
208223 reconciler_task_log,
209224 ) ;
0 commit comments