oxidecomputer / oxidecomputer/omicron

how-to-run (simulated) instructions aren't quite right

Open
#2,845 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

development
Dominant language
Rust
Stars
572
Forks
97
Avg merge
2d 12h
Merged PRs (30d)
96

Description

If you just follow the https://github.com/oxidecomputer/omicron/blob/main/docs/how-to-run-simulated.adoc instructions today, you eventually get to:

Once everything is up and running, you can use the system in a few ways:

  • Use the browser-based console. The Nexus log output will show what IP address and port it’s listening on. This is also configured in the config file. If you’re using the defaults, you can reach the console at http://127.0.0.1:12220/projects. Depending on the environment where you’re running this, you may need an ssh tunnel or the like to reach this from your browser.
  • Use the oxide CLI.

Last week i tried to use the console, but it failed client-side validation because I had no images.

Today I tried to use the current CLI (that is, oxide-sdk-and-cli, commit 4df81577b1c80ca9f41e8d3f61a70d83fe48c66e, which is admittedly pretty old now), but it failed because:

$ cargo run -- instance create --project p --description d --hostname h --memory 2gib --name i1 --ncpus 1
    Finished dev [unoptimized + debuginfo] target(s) in 0.16s
     Running `target/debug/oxide instance create --project p --description d --hostname h --memory 2gib --name i1 --ncpus 1`
error
Error Response: status: 400 Bad Request; headers: {"content-type": "application/json", "x-request-id": "df27ac9e-f465-44d4-bdde-3de0a6e81075", "content-length": "143", "date": "Fri, 14 Apr 2023 22:07:24 GMT"}; value: Error { error_code: Some("InvalidRequest"), message: "No external IP addresses available", request_id: "df27ac9e-f465-44d4-bdde-3de0a6e81075" }

I'm guessing I need to create an external IP pool and maybe the instructions need to say that? But the test suite doesn't seem to require that, and these are simulated instances anyway. Maybe we just need a way for the CLI to request no external IP? Or have ControlPlaneTestContext add a fake network pool with whatever addresses we want? That does work, even if those addresses don't work:

$ cargo run -- api /v1/system/ip-pools/default/ranges/add --method POST --input - <<EOF
{
  "first": "172.20.15.227",
  "last": "172.20.15.239"
}
EOF
    Finished dev [unoptimized + debuginfo] target(s) in 0.18s
     Running `target/debug/oxide api /v1/system/ip-pools/default/ranges/add --method POST --input -`
{
  "id": "56547c17-81fa-4f70-8b4a-d79289be9947",
  "range": {
    "first": "172.20.15.227",
    "last": "172.20.15.239"
  },
  "time_created": "2023-04-14T22:11:30.224497Z"
}

$ cargo run -- instance create --project p --description d --hostname h --memory 2gib --name i1 --ncpus 1 
    Finished dev [unoptimized + debuginfo] target(s) in 0.17s
     Running `target/debug/oxide instance create --project p --description d --hostname h --memory 2gib --name i1 --ncpus 1`
success
Instance {
    description: "d",
    hostname: "h",
    id: 26fe8575-c096-4cc9-855a-396d5fb4f13e,
    memory: ByteCount(
        2147483648,
    ),
    name: Name(
        "i1",
    ),
    ncpus: InstanceCpuCount(
        1,
    ),
    project_id: 2ea62e98-fe91-4f90-9b68-0573a05f9c86,
    run_state: Starting,
    time_created: 2023-04-14T22:11:52.387080Z,
    time_modified: 2023-04-14T22:11:52.387080Z,
    time_run_state_updated: 2023-04-14T22:11:52.884186Z,
}

CC @david-crespo @ahl

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with docs/how-to-run-simulated.adoc and docs/cli.adoc, then reproduce the documented instance-creation flow with the current CLI. Check the referenced ControlPlaneTestContext setup and determine which prerequisites, such as an external IP pool or image setup, are required; done means the instructions accurately lead to a usable simulated instance or clearly document the necessary setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli, documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.