From 1be32487c6ded54adb86a377bbff0d095b1a5c9e Mon Sep 17 00:00:00 2001 From: David Pacheco Date: Thu, 14 Apr 2022 12:42:37 -0700 Subject: [PATCH 1/3] sled-agent-sim and docs need update for IPv6 requirement --- docs/how-to-run-simulated.adoc | 4 +--- sled-agent/src/bin/sled-agent-sim.rs | 7 ++++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/how-to-run-simulated.adoc b/docs/how-to-run-simulated.adoc index 039cc0d662..5b21e9df09 100644 --- a/docs/how-to-run-simulated.adoc +++ b/docs/how-to-run-simulated.adoc @@ -122,9 +122,7 @@ Nexus can also serve the web console. Instructions for generating the static ass + [source,text] ---- -$ cargo run --bin=sled-agent-sim -- $(uuidgen) 127.0.0.1:12345 127.0.0.1:12221 -... -Jun 02 12:21:50.989 INFO listening, local_addr: 127.0.0.1:12345, component: dropshot +$ cargo run --bin=sled-agent-sim -- $(uuidgen) [::1]:12345 127.0.0.1:12221 ---- . `oximeter` is similar to `nexus`, requiring a configuration file. You can use `oximeter/collector/config.toml`, and the whole thing can be run with: diff --git a/sled-agent/src/bin/sled-agent-sim.rs b/sled-agent/src/bin/sled-agent-sim.rs index 61adec0ce5..1c03cf27bc 100644 --- a/sled-agent/src/bin/sled-agent-sim.rs +++ b/sled-agent/src/bin/sled-agent-sim.rs @@ -17,6 +17,7 @@ use omicron_sled_agent::sim::{ use std::net::SocketAddr; use structopt::StructOpt; use uuid::Uuid; +use std::net::SocketAddrV6; fn parse_sim_mode(src: &str) -> Result { match src { @@ -44,7 +45,7 @@ struct Args { uuid: Uuid, #[structopt(name = "SA_IP:PORT", parse(try_from_str))] - sled_agent_addr: SocketAddr, + sled_agent_addr: SocketAddrV6, #[structopt(name = "NEXUS_IP:PORT", parse(try_from_str))] nexus_addr: SocketAddr, @@ -67,7 +68,7 @@ async fn do_run() -> Result<(), CmdError> { sim_mode: args.sim_mode, nexus_address: args.nexus_addr, dropshot: ConfigDropshot { - bind_address: args.sled_agent_addr, + bind_address: args.sled_agent_addr.into(), request_body_max_bytes: 1024 * 1024, ..Default::default() }, @@ -75,7 +76,7 @@ async fn do_run() -> Result<(), CmdError> { storage: ConfigStorage { // Create 10 "virtual" U.2s, with 1 TB of storage. zpools: vec![ConfigZpool { size: 1 << 40 }; 10], - ip: args.sled_agent_addr.ip(), + ip: args.sled_agent_addr.ip().clone().into(), }, }; From 4834a10db6e31bf610a6383641692c109699fc7a Mon Sep 17 00:00:00 2001 From: David Pacheco Date: Thu, 14 Apr 2022 12:46:43 -0700 Subject: [PATCH 2/3] fix style --- sled-agent/src/bin/sled-agent-sim.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sled-agent/src/bin/sled-agent-sim.rs b/sled-agent/src/bin/sled-agent-sim.rs index 1c03cf27bc..1a6481089e 100644 --- a/sled-agent/src/bin/sled-agent-sim.rs +++ b/sled-agent/src/bin/sled-agent-sim.rs @@ -15,9 +15,9 @@ use omicron_sled_agent::sim::{ run_server, Config, ConfigStorage, ConfigZpool, SimMode, }; use std::net::SocketAddr; +use std::net::SocketAddrV6; use structopt::StructOpt; use uuid::Uuid; -use std::net::SocketAddrV6; fn parse_sim_mode(src: &str) -> Result { match src { From 873d92c25c631942b08eeb396fe96d0782cf0552 Mon Sep 17 00:00:00 2001 From: David Pacheco Date: Thu, 14 Apr 2022 12:48:27 -0700 Subject: [PATCH 3/3] clippy --- sled-agent/src/bin/sled-agent-sim.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sled-agent/src/bin/sled-agent-sim.rs b/sled-agent/src/bin/sled-agent-sim.rs index 1a6481089e..4aa2553301 100644 --- a/sled-agent/src/bin/sled-agent-sim.rs +++ b/sled-agent/src/bin/sled-agent-sim.rs @@ -76,7 +76,7 @@ async fn do_run() -> Result<(), CmdError> { storage: ConfigStorage { // Create 10 "virtual" U.2s, with 1 TB of storage. zpools: vec![ConfigZpool { size: 1 << 40 }; 10], - ip: args.sled_agent_addr.ip().clone().into(), + ip: (*args.sled_agent_addr.ip()).into(), }, };