Skip to content

omicron-dev should run simulated sled agent with SimMode::Auto #2810

@gjcolombo

Description

@gjcolombo

The omicron-dev tool runs an in-process simulated sled agent that shares a configuration with the integration tests' configuration:

pub async fn start_sled_agent(
log: Logger,
nexus_address: SocketAddr,
id: Uuid,
update_directory: &Path,
) -> Result<sim::Server, String> {
let config = sim::Config {
id,
sim_mode: sim::SimMode::Explicit,
nexus_address,
dropshot: ConfigDropshot {
bind_address: SocketAddr::new(Ipv6Addr::LOCALHOST.into(), 0),
request_body_max_bytes: 1024 * 1024,
..Default::default()
},
// TODO-cleanup this is unused
log: ConfigLogging::StderrTerminal { level: ConfigLoggingLevel::Debug },
storage: sim::ConfigStorage {
zpools: vec![],
ip: IpAddr::from(Ipv6Addr::LOCALHOST),
},
updates: sim::ConfigUpdates {
zone_artifact_path: update_directory.to_path_buf(),
},
};
let (server, _rack_init_request) =
sim::Server::start(&config, &log).await?;
Ok(server)
}

This configuration specifies that the simulation should run in Explicit mode. In this mode, simulated objects like instances need to be poked explicitly (by calling the right simulated agent endpoint) to transition between states. For local development purposes, where there's a user playing around with the simulation instead of a test that's poking objects to generate state transitions, it would be nice if the simulation ran in Auto mode to match sled-agent-sim's default behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Sled AgentRelated to the Per-Sled Configuration and Management

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions