Skip to content

propolis-cli: accept ip:port for server address#1148

Open
MorganaFuture wants to merge 1 commit into
oxidecomputer:masterfrom
MorganaFuture:cli-server-ip-port
Open

propolis-cli: accept ip:port for server address#1148
MorganaFuture wants to merge 1 commit into
oxidecomputer:masterfrom
MorganaFuture:cli-server-ip-port

Conversation

@MorganaFuture
Copy link
Copy Markdown

propolis-cli -s parsed its argument as a bare host and discarded any port, so passing -s 127.0.0.1:12345 (the form propolis-server prints and accepts) failed with "node name or service name not known". This parses the server argument as a full socket address and drops the now-redundant -p flag, so -s takes IP:PORT the same way propolis-server run already does. The migrate destination argument gets the same treatment, and the README/docs examples are updated to match.

Note this is a small breaking change to the CLI: a port is now required (there's no default 12400 anymore), per the issue's suggestion to "expect ip:port in all cases".

Closes #1062.

Tested with cargo test -p propolis-cli (added unit tests for the parser) and cargo clippy, built on Linux. I don't have an illumos host, so I couldn't exercise the CLI end-to-end against a running propolis-server.

`-s` parsed only a host and threw away any port, so `-s 127.0.0.1:12345`
failed with a name resolution error. Parse the server argument as a full
socket address and drop the now-redundant `-p` flag, matching how
propolis-server already takes its IP:PORT argument.
@iximeow
Copy link
Copy Markdown
Member

iximeow commented Jun 3, 2026

hello! this'll be a nice, and thank you for including the docs in the change as well 🙏

fwiw I am realizing now that while I thought I'd spoken a bit off-the-cuff in saying "ip:port in all cases", that in fact propolis-server also does not have the idea of a default port (let alone 12400) - the fact that propolis-server ends up on 12400 is from the SMF manifest (other parts of the system assume the same default). then when I've used 12400 locally it's just habit 'cause that's what the CLI used as a default.. we maybe should formalize that the default port is 12400 both to propolis-server and propolis-cli.. anyway being able to use the same sockaddr on both CLIs will be nice.

you didn't hear this from me but if you do want to give this a try end to end: if you run an illumos guest on a Linux host, from that guest's perspective a nested VM will work well enough to at least see this change work with propolis-cli/propolis-server. nowhere near well enough to do any serious changes to Propolis or bhyve :D either way I'll give this a quick run on my illumos machine. not asking you to do that unless you think it'd be fun!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

propolis-cli -s is very confused with a port number

2 participants