3
3
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
4
4
5
5
use camino:: Utf8PathBuf ;
6
- use illumos_utils:: dladm:: EtherstubVnic ;
7
6
use illumos_utils:: zpool:: PathInPool ;
8
7
use key_manager:: StorageKeyRequester ;
9
8
use nexus_sled_agent_shared:: inventory:: InventoryDataset ;
@@ -14,10 +13,12 @@ use omicron_common::disk::DatasetName;
14
13
use omicron_common:: disk:: DiskIdentity ;
15
14
use sled_agent_api:: ArtifactConfig ;
16
15
use sled_storage:: config:: MountConfig ;
16
+ use sled_storage:: disk:: Disk ;
17
17
use sled_storage:: manager:: NestedDatasetConfig ;
18
18
use sled_storage:: manager:: NestedDatasetListOptions ;
19
19
use sled_storage:: manager:: NestedDatasetLocation ;
20
20
use slog:: Logger ;
21
+ use std:: collections:: HashSet ;
21
22
use std:: sync:: Arc ;
22
23
use std:: sync:: OnceLock ;
23
24
use tokio:: sync:: watch;
@@ -45,6 +46,7 @@ use crate::SledAgentFacilities;
45
46
use crate :: TimeSyncStatus ;
46
47
use crate :: dataset_serialization_task:: DatasetTaskHandle ;
47
48
use crate :: dataset_serialization_task:: NestedDatasetMountError ;
49
+ use crate :: dump_setup_task;
48
50
use crate :: internal_disks:: InternalDisksReceiver ;
49
51
use crate :: ledger:: LedgerTaskHandle ;
50
52
use crate :: raw_disks;
@@ -68,6 +70,7 @@ pub struct ConfigReconcilerSpawnToken {
68
70
time_sync_config : TimeSyncConfig ,
69
71
reconciler_result_tx : watch:: Sender < ReconcilerResult > ,
70
72
currently_managed_zpools_tx : watch:: Sender < Arc < CurrentlyManagedZpools > > ,
73
+ external_disks_tx : watch:: Sender < HashSet < Disk > > ,
71
74
ledger_task_log : Logger ,
72
75
reconciler_task_log : Logger ,
73
76
}
@@ -111,6 +114,16 @@ impl ConfigReconcilerHandle {
111
114
base_log,
112
115
) ;
113
116
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
+
114
127
let ( reconciler_result_tx, reconciler_result_rx) =
115
128
watch:: channel ( ReconcilerResult :: default ( ) ) ;
116
129
let ( currently_managed_zpools_tx, currently_managed_zpools_rx) =
@@ -142,6 +155,7 @@ impl ConfigReconcilerHandle {
142
155
time_sync_config,
143
156
reconciler_result_tx,
144
157
currently_managed_zpools_tx,
158
+ external_disks_tx,
145
159
ledger_task_log : base_log
146
160
. new ( slog:: o!( "component" => "SledConfigLedgerTask" ) ) ,
147
161
reconciler_task_log : base_log
@@ -164,7 +178,6 @@ impl ConfigReconcilerHandle {
164
178
U : SledAgentArtifactStore ,
165
179
> (
166
180
& self ,
167
- underlay_vnic : EtherstubVnic ,
168
181
sled_agent_facilities : T ,
169
182
sled_agent_artifact_store : U ,
170
183
token : ConfigReconcilerSpawnToken ,
@@ -174,6 +187,7 @@ impl ConfigReconcilerHandle {
174
187
time_sync_config,
175
188
reconciler_result_tx,
176
189
currently_managed_zpools_tx,
190
+ external_disks_tx,
177
191
ledger_task_log,
178
192
reconciler_task_log,
179
193
} = token;
@@ -198,12 +212,13 @@ impl ConfigReconcilerHandle {
198
212
}
199
213
200
214
reconciler_task:: spawn (
215
+ Arc :: clone ( self . internal_disks_rx . mount_config ( ) ) ,
201
216
key_requester,
202
217
time_sync_config,
203
- underlay_vnic,
204
218
current_config_rx,
205
219
reconciler_result_tx,
206
220
currently_managed_zpools_tx,
221
+ external_disks_tx,
207
222
sled_agent_facilities,
208
223
reconciler_task_log,
209
224
) ;
0 commit comments