-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[nexus] Populate IP pool, nexus service information, during rack setup (
#2358) # Summary My long-term goal is to have Nexus be in charge of provisioning all services. For that to be possible, Nexus must be able to internalize all input during the handoff from RSS. This PR extends the RSS -> Nexus handoff to include: - What "Nexus Services" are being launched? - What are the ranges of IP addresses that may be used for internal services? - What external IP addresses, from that pool, are currently in-use for Nexus services? # Nexus Changes ## Database Records - Adds a `nexus_service` record, which just includes the information about the in-use external IP address. ## IP Address Allocation - Adds an `explicit_ip` option, which lets callers perform an allocation with an explicit request for a single IP address. You might ask the question: "Why not just directly create a record with the IP address in question, if you want to create it?" We could! But we'd need to recreate all the logic which validates that the IP address exists within the known-to-the-DB IP ranges within the pool. - The ability for an operator to "request Nexus execute with a specific IP address" is a feature we want anyway, so this isn't wasted work. - The implementation and tests for this behavior are mostly within `nexus/src/db/queries/external_ip.rs` ## Rack Initialization - Populates IP pools and Service records as a part of the RSS handoff. - Implementation and tests exist within `nexus/src/db/datastore/rack.rs`. ## Populate - Move the body of some of the "populate" functions into their correct spot in the datastore, which makes it easier to... - ... call all the populate functions -- rather than just a chunk of them -- from `omicron_nexus::db::datastore::datastore_test`. - As a consequence, update some tests which assumed the rack would be "half-populated" -- it's either fully populated, or not populated at all. # Sled Agent changes - Explicitly pass the "IP pool ranges for internal services" up to Nexus. - In the future, it'll be possible to pass a larger range of addresses than just those used by running Nexus services. Fixes: #1958 Unblocks: #732
- Loading branch information
Showing
21 changed files
with
1,245 additions
and
171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this | ||
// file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
||
use crate::schema::nexus_service; | ||
use uuid::Uuid; | ||
|
||
/// Nexus-specific extended service information. | ||
#[derive(Queryable, Insertable, Debug, Clone, Selectable)] | ||
#[diesel(table_name = nexus_service)] | ||
pub struct NexusService { | ||
pub id: Uuid, | ||
pub external_ip_id: Uuid, | ||
} | ||
|
||
impl NexusService { | ||
pub fn new(id: Uuid, external_ip_id: Uuid) -> Self { | ||
Self { id, external_ip_id } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.