diff --git a/Cargo.lock b/Cargo.lock index 7ebb3a825bb..99d9bdc8508 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1725,6 +1725,15 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "colored" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fde0e0ec90c9dfb3b4b1a0891a7dcd0e2bffde2f7efed5fe7c9bb00e5bfb915e" +dependencies = [ + "windows-sys 0.48.0", +] + [[package]] name = "common" version = "0.1.0" @@ -2458,14 +2467,12 @@ dependencies = [ [[package]] name = "ddm-admin-client" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/maghemite?rev=08f2a34d487658e87545ffbba3add632a82baf0d#08f2a34d487658e87545ffbba3add632a82baf0d" +source = "git+https://github.com/oxidecomputer/maghemite?rev=835553064c9702789fc09af7fa1eb3f12caa91c5#835553064c9702789fc09af7fa1eb3f12caa91c5" dependencies = [ "oxnet", - "percent-encoding", "progenitor 0.11.2", "reqwest", "serde", - "serde_json", "slog", "uuid", ] @@ -3291,7 +3298,7 @@ dependencies = [ "bytes", "chrono", "clap", - "colored", + "colored 2.2.0", "dhcproto", "futures", "hickory-resolver 0.25.2", @@ -5828,7 +5835,7 @@ dependencies = [ "anyhow", "camino", "clap", - "colored", + "colored 2.2.0", "futures", "indicatif 0.17.11", "libc", @@ -5900,7 +5907,7 @@ source = "git+https://github.com/oxidecomputer/netadm-sys?branch=main#f4eae3d807 dependencies = [ "anyhow", "cfg-if", - "colored", + "colored 2.2.0", "dlpi", "libc", "num_enum", @@ -6305,17 +6312,19 @@ dependencies = [ [[package]] name = "mg-admin-client" version = "0.1.0" -source = "git+https://github.com/oxidecomputer/maghemite?rev=08f2a34d487658e87545ffbba3add632a82baf0d#08f2a34d487658e87545ffbba3add632a82baf0d" +source = "git+https://github.com/oxidecomputer/maghemite?rev=835553064c9702789fc09af7fa1eb3f12caa91c5#835553064c9702789fc09af7fa1eb3f12caa91c5" dependencies = [ - "anyhow", "chrono", - "percent-encoding", + "colored 3.0.0", "progenitor 0.11.2", + "rdb-types", "reqwest", "schemars 0.8.22", "serde", "serde_json", "slog", + "tabwriter", + "uuid", ] [[package]] @@ -8367,6 +8376,7 @@ dependencies = [ "range-requests", "raw-cpuid", "rcgen", + "rdb-types", "ref-cast", "regex", "reqwest", @@ -8800,6 +8810,7 @@ dependencies = [ "rand 0.9.2", "range-requests", "rcgen", + "rdb-types", "regress", "repo-depot-api", "repo-depot-client", @@ -11323,6 +11334,16 @@ dependencies = [ "yasna", ] +[[package]] +name = "rdb-types" +version = "0.1.0" +source = "git+https://github.com/oxidecomputer/maghemite?rev=835553064c9702789fc09af7fa1eb3f12caa91c5#835553064c9702789fc09af7fa1eb3f12caa91c5" +dependencies = [ + "oxnet", + "schemars 0.8.22", + "serde", +] + [[package]] name = "reconfigurator-cli" version = "0.1.0" @@ -11333,7 +11354,7 @@ dependencies = [ "camino-tempfile", "chrono", "clap", - "colored", + "colored 2.2.0", "daft", "datatest-stable", "dropshot", @@ -14679,7 +14700,7 @@ dependencies = [ "anyhow", "camino", "clap", - "colored", + "colored 2.2.0", "daft", "iddqd", "omicron-repl-utils", diff --git a/Cargo.toml b/Cargo.toml index 196c399a812..28dfdedaca1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -538,8 +538,8 @@ newtype_derive = "0.1.6" ntp-admin-api = { path = "ntp-admin/api" } ntp-admin-client = { path = "clients/ntp-admin-client" } ntp-admin-types = { path = "ntp-admin/types" } -mg-admin-client = { git = "https://github.com/oxidecomputer/maghemite", rev = "08f2a34d487658e87545ffbba3add632a82baf0d" } -ddm-admin-client = { git = "https://github.com/oxidecomputer/maghemite", rev = "08f2a34d487658e87545ffbba3add632a82baf0d" } +mg-admin-client = { git = "https://github.com/oxidecomputer/maghemite", rev = "835553064c9702789fc09af7fa1eb3f12caa91c5" } +ddm-admin-client = { git = "https://github.com/oxidecomputer/maghemite", rev = "835553064c9702789fc09af7fa1eb3f12caa91c5" } multimap = "0.10.1" nexus-auth = { path = "nexus/auth" } nexus-background-task-interface = { path = "nexus/background-task-interface" } @@ -667,6 +667,7 @@ ratatui = "0.29.0" raw-cpuid = { git = "https://github.com/oxidecomputer/rust-cpuid.git", rev = "a4cf01df76f35430ff5d39dc2fe470bcb953503b" } rayon = "1.10" rcgen = "0.12.1" +rdb-types = { git = "https://github.com/oxidecomputer/maghemite", rev = "835553064c9702789fc09af7fa1eb3f12caa91c5" } reconfigurator-cli = { path = "dev-tools/reconfigurator-cli" } reedline = "0.40.0" ref-cast = "1.0" diff --git a/common/src/api/external/mod.rs b/common/src/api/external/mod.rs index dd760fb85cf..c321808d9e7 100644 --- a/common/src/api/external/mod.rs +++ b/common/src/api/external/mod.rs @@ -3281,6 +3281,11 @@ pub enum BgpPeerState { /// Waiting for keepaliave or notification from peer. OpenConfirm, + /// There is an ongoing Connection Collision that hasn't yet been resolved. + /// Two connections are maintained until one connection receives an Open or + /// is able to progress into Established. + ConnectionCollision, + /// Synchronizing with peer. SessionSetup, @@ -3298,6 +3303,9 @@ impl From for BgpPeerState { FsmStateKind::Active => BgpPeerState::Active, FsmStateKind::OpenSent => BgpPeerState::OpenSent, FsmStateKind::OpenConfirm => BgpPeerState::OpenConfirm, + FsmStateKind::ConnectionCollision => { + BgpPeerState::ConnectionCollision + } FsmStateKind::SessionSetup => BgpPeerState::SessionSetup, FsmStateKind::Established => BgpPeerState::Established, } diff --git a/nexus/Cargo.toml b/nexus/Cargo.toml index 1145813c01d..39d7f83b8f4 100644 --- a/nexus/Cargo.toml +++ b/nexus/Cargo.toml @@ -87,6 +87,7 @@ qorb.workspace = true rand.workspace = true range-requests.workspace = true ref-cast.workspace = true +rdb-types.workspace = true regex.workspace = true reqwest = { workspace = true, features = ["json"] } ring.workspace = true diff --git a/nexus/db-queries/src/db/datastore/vpc.rs b/nexus/db-queries/src/db/datastore/vpc.rs index 52bab75182b..31b763dff8a 100644 --- a/nexus/db-queries/src/db/datastore/vpc.rs +++ b/nexus/db-queries/src/db/datastore/vpc.rs @@ -3905,10 +3905,10 @@ mod tests { assert!(resolved.iter().any(|x| { let k = &x.dest; let v = &x.target; - *k == subnet.ipv4_block.0.into() + *k == IpNet::from(subnet.ipv4_block.0) && match v { RouterTarget::VpcSubnet(ip) => { - *ip == subnet.ipv4_block.0.into() + *ip == IpNet::from(subnet.ipv4_block.0) } _ => false, } @@ -3916,10 +3916,10 @@ mod tests { assert!(resolved.iter().any(|x| { let k = &x.dest; let v = &x.target; - *k == subnet.ipv6_block.0.into() + *k == IpNet::from(subnet.ipv6_block.0) && match v { RouterTarget::VpcSubnet(ip) => { - *ip == subnet.ipv6_block.0.into() + *ip == IpNet::from(subnet.ipv6_block.0) } _ => false, } diff --git a/nexus/src/app/background/tasks/sync_switch_configuration.rs b/nexus/src/app/background/tasks/sync_switch_configuration.rs index 7aeccc90817..9844d9d536b 100644 --- a/nexus/src/app/background/tasks/sync_switch_configuration.rs +++ b/nexus/src/app/background/tasks/sync_switch_configuration.rs @@ -30,8 +30,7 @@ use futures::future::BoxFuture; use mg_admin_client::types::{ AddStaticRoute4Request, ApplyRequest, BgpPeerConfig, CheckerSource, DeleteStaticRoute4Request, ImportExportPolicy as MgImportExportPolicy, - Prefix as MgPrefix, Prefix4, Prefix6, ShaperSource, StaticRoute4, - StaticRoute4List, + ShaperSource, StaticRoute4, StaticRoute4List, }; use nexus_db_queries::{ context::OpContext, @@ -47,6 +46,7 @@ use omicron_common::{ internal::shared::ParseSwitchLocationError, }, }; +use rdb_types::{Prefix as MgPrefix, Prefix4, Prefix6}; use serde_json::json; use sled_agent_client::types::{ BgpConfig as SledBgpConfig, BgpPeerConfig as SledBgpPeerConfig, diff --git a/nexus/src/app/bgp.rs b/nexus/src/app/bgp.rs index 149568d34fb..60f23d958d4 100644 --- a/nexus/src/app/bgp.rs +++ b/nexus/src/app/bgp.rs @@ -123,7 +123,7 @@ impl super::Nexus { for r in &router_info { let asn = r.asn; - let peers = match client.get_neighbors(asn).await { + let peers = match client.get_neighbors_v2(asn).await { Ok(result) => result.into_inner(), Err(e) => { error!( @@ -196,12 +196,12 @@ impl super::Nexus { let mut xps = Vec::new(); for ex in exports.iter() { let net = match ex { - mg_admin_client::types::Prefix::V4(v4) => { + rdb_types::Prefix::V4(v4) => { oxnet::Ipv4Net::new_unchecked( v4.value, v4.length, ) } - mg_admin_client::types::Prefix::V6(v6) => { + rdb_types::Prefix::V6(v6) => { let v6 = oxnet::IpNet::V6( oxnet::Ipv6Net::new_unchecked( v6.value, v6.length, @@ -237,7 +237,11 @@ impl super::Nexus { )) })? { let history = match client - .message_history(&MessageHistoryRequest { asn: sel.asn }) + .message_history_v2(&MessageHistoryRequest { + asn: sel.asn, + direction: None, + peer: None, + }) .await { Ok(result) => result.into_inner().by_peer.clone(), @@ -265,7 +269,7 @@ impl super::Nexus { pub async fn bgp_imported_routes_ipv4( &self, opctx: &OpContext, - sel: ¶ms::BgpRouteSelector, + _sel: ¶ms::BgpRouteSelector, ) -> ListResultVec { opctx.authorize(authz::Action::Read, &authz::FLEET).await?; let mut result = Vec::new(); @@ -276,9 +280,7 @@ impl super::Nexus { })? { let mut imported: Vec = Vec::new(); match client - .get_imported(&mg_admin_client::types::AsnSelector { - asn: sel.asn, - }) + .get_rib_imported(Some(&rdb_types::AddressFamily::Ipv4), None) .await { Ok(result) => { diff --git a/nexus/tests/integration_tests/switch_port.rs b/nexus/tests/integration_tests/switch_port.rs index 10d308cf90f..3af6dd22822 100644 --- a/nexus/tests/integration_tests/switch_port.rs +++ b/nexus/tests/integration_tests/switch_port.rs @@ -23,6 +23,7 @@ use omicron_common::api::external::{ LinkSpeed, NameOrId, SwitchPort, SwitchPortSettings, }; use omicron_common::api::external::{ImportExportPolicy, Name}; +use oxnet::IpNet; type ControlPlaneTestContext = nexus_test_utils::ControlPlaneTestContext; @@ -229,11 +230,11 @@ async fn test_port_settings_basic_crud(ctx: &ControlPlaneTestContext) { assert_eq!(ifx0.kind, external::SwitchInterfaceKind::Primary); let route0 = &created.routes[0]; - assert_eq!(route0.dst, "1.2.3.0/24".parse().unwrap()); + assert_eq!(route0.dst, IpNet::from_str("1.2.3.0/24").unwrap()); assert_eq!(&route0.gw.to_string(), "1.2.3.4"); let addr0 = &created.addresses[0]; - assert_eq!(addr0.address, "203.0.113.10/24".parse().unwrap()); + assert_eq!(addr0.address, IpNet::from_str("203.0.113.10/24").unwrap()); // Get the port settings back let roundtrip: SwitchPortSettings = NexusRequest::object_get( @@ -271,11 +272,11 @@ async fn test_port_settings_basic_crud(ctx: &ControlPlaneTestContext) { assert_eq!(ifx0.kind, external::SwitchInterfaceKind::Primary); let route0 = &roundtrip.routes[0]; - assert_eq!(route0.dst, "1.2.3.0/24".parse().unwrap()); + assert_eq!(route0.dst, IpNet::from_str("1.2.3.0/24").unwrap()); assert_eq!(&route0.gw.to_string(), "1.2.3.4"); let addr0 = &roundtrip.addresses[0]; - assert_eq!(addr0.address, "203.0.113.10/24".parse().unwrap()); + assert_eq!(addr0.address, IpNet::from_str("203.0.113.10/24").unwrap()); // Delete port settings NexusRequest::object_delete( diff --git a/openapi/nexus.json b/openapi/nexus.json index 4a418f0d323..6ff1c6ada93 100644 --- a/openapi/nexus.json +++ b/openapi/nexus.json @@ -16324,6 +16324,13 @@ "open_confirm" ] }, + { + "description": "There is an ongoing Connection Collision that hasn't yet been resolved. Two connections are maintained until one connection receives an Open or is able to progress into Established.", + "type": "string", + "enum": [ + "connection_collision" + ] + }, { "description": "Synchronizing with peer.", "type": "string", diff --git a/package-manifest.toml b/package-manifest.toml index 3675aecea51..f8f6ac1d2b2 100644 --- a/package-manifest.toml +++ b/package-manifest.toml @@ -654,10 +654,10 @@ source.repo = "maghemite" # `tools/maghemite_openapi_version`. Failing to do so will cause a failure when # building `ddm-admin-client` (which will instruct you to update # `tools/maghemite_openapi_version`). -source.commit = "08f2a34d487658e87545ffbba3add632a82baf0d" +source.commit = "835553064c9702789fc09af7fa1eb3f12caa91c5" # The SHA256 digest is automatically posted to: # https://buildomat.eng.oxide.computer/public/file/oxidecomputer/maghemite/image//mg-ddm-gz.sha256.txt -source.sha256 = "b11b8446669c525342c5a5e70e8d6bfffb637d23b4c30a0f39c964bd2c2cb972" +source.sha256 = "86ffc098943954a3850cdbe792e7137988b8d219a29a8db118b61d9c04019465" output.type = "tarball" [package.mg-ddm] @@ -670,10 +670,10 @@ source.repo = "maghemite" # `tools/maghemite_openapi_version`. Failing to do so will cause a failure when # building `ddm-admin-client` (which will instruct you to update # `tools/maghemite_openapi_version`). -source.commit = "08f2a34d487658e87545ffbba3add632a82baf0d" +source.commit = "835553064c9702789fc09af7fa1eb3f12caa91c5" # The SHA256 digest is automatically posted to: # https://buildomat.eng.oxide.computer/public/file/oxidecomputer/maghemite/image//mg-ddm.sha256.txt -source.sha256 = "56aa1984ba58fd4d64eba3a0c321cdfbcd22f97f9c31e20055fd6292b7f69bdc" +source.sha256 = "2e23ad7aaa5bd170ac93d94869523a339cd7e2f4fb9b186cda0da153267f96aa" output.type = "zone" output.intermediate_only = true @@ -685,10 +685,10 @@ source.repo = "maghemite" # `tools/maghemite_openapi_version`. Failing to do so will cause a failure when # building `ddm-admin-client` (which will instruct you to update # `tools/maghemite_openapi_version`). -source.commit = "08f2a34d487658e87545ffbba3add632a82baf0d" +source.commit = "835553064c9702789fc09af7fa1eb3f12caa91c5" # The SHA256 digest is automatically posted to: # https://buildomat.eng.oxide.computer/public/file/oxidecomputer/maghemite/image//mgd.sha256.txt -source.sha256 = "5f0f682cd13e18b7bb428aff336ee7e42796e43a5cbbab7a23b086d0fd67050b" +source.sha256 = "2cc222793487c19fd42da538477515779861b5a79c16fb0c9e5859f1feda5809" output.type = "zone" output.intermediate_only = true diff --git a/sled-agent/Cargo.toml b/sled-agent/Cargo.toml index 54d64a2e101..001ceb7b817 100644 --- a/sled-agent/Cargo.toml +++ b/sled-agent/Cargo.toml @@ -75,6 +75,7 @@ propolis-mock-server.workspace = true # Only used by the simulated sled agent propolis_api_types.workspace = true rand = { workspace = true, features = ["os_rng"] } range-requests.workspace = true +rdb-types.workspace = true repo-depot-api.workspace = true repo-depot-client.workspace = true reqwest = { workspace = true, features = ["rustls-tls", "stream"] } diff --git a/sled-agent/src/bootstrap/early_networking.rs b/sled-agent/src/bootstrap/early_networking.rs index 6456c7ef210..0fbea9555ca 100644 --- a/sled-agent/src/bootstrap/early_networking.rs +++ b/sled-agent/src/bootstrap/early_networking.rs @@ -19,8 +19,8 @@ use mg_admin_client::types::BfdPeerConfig as MgBfdPeerConfig; use mg_admin_client::types::BgpPeerConfig as MgBgpPeerConfig; use mg_admin_client::types::ImportExportPolicy as MgImportExportPolicy; use mg_admin_client::types::{ - AddStaticRoute4Request, ApplyRequest, CheckerSource, Prefix, Prefix4, - Prefix6, ShaperSource, StaticRoute4, StaticRoute4List, + AddStaticRoute4Request, ApplyRequest, CheckerSource, ShaperSource, + StaticRoute4, StaticRoute4List, }; use omicron_common::OMICRON_DPD_TAG; use omicron_common::address::DENDRITE_PORT; @@ -35,6 +35,7 @@ use omicron_common::backoff::{ }; use omicron_ddm_admin_client::DdmError; use oxnet::IpNet; +use rdb_types::{Prefix, Prefix4, Prefix6}; use slog::Logger; use slog_error_chain::InlineErrorChain; use std::collections::{HashMap, HashSet}; diff --git a/tools/maghemite_ddm_openapi_version b/tools/maghemite_ddm_openapi_version index dd2971ce541..2cc86b1b1de 100644 --- a/tools/maghemite_ddm_openapi_version +++ b/tools/maghemite_ddm_openapi_version @@ -1,2 +1,2 @@ -COMMIT="08f2a34d487658e87545ffbba3add632a82baf0d" +COMMIT="835553064c9702789fc09af7fa1eb3f12caa91c5" SHA2="9146aaf60a52ecd138139708e4019e4496f330fb81a2c5a7a70cd3436a6a1318" diff --git a/tools/maghemite_mg_openapi_version b/tools/maghemite_mg_openapi_version index 4cf12e18593..afba10121ed 100644 --- a/tools/maghemite_mg_openapi_version +++ b/tools/maghemite_mg_openapi_version @@ -1,2 +1,2 @@ -COMMIT="08f2a34d487658e87545ffbba3add632a82baf0d" +COMMIT="835553064c9702789fc09af7fa1eb3f12caa91c5" SHA2="3d68b221bd0a72cf87195a8a4c8ae408daadf50763349606b9df8186b2d6fe9a" diff --git a/tools/maghemite_mgd_checksums b/tools/maghemite_mgd_checksums index 6bd19cd9c27..140900fc6eb 100644 --- a/tools/maghemite_mgd_checksums +++ b/tools/maghemite_mgd_checksums @@ -1,2 +1,2 @@ -CIDL_SHA256="5f0f682cd13e18b7bb428aff336ee7e42796e43a5cbbab7a23b086d0fd67050b" -MGD_LINUX_SHA256="810c1f590ad319c5e94990f485e8b98456087bf0b9d5ddba3abf03665690177f" \ No newline at end of file +CIDL_SHA256="2cc222793487c19fd42da538477515779861b5a79c16fb0c9e5859f1feda5809" +MGD_LINUX_SHA256="db36fd88c55dfaf0e42f0ca56565aee0fd884030d78e7b26130600e27be57bd3"