-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
server: remove config TOML processing
Remove the propolis-server logic to add devices from the config TOML when fielding an instance ensure request. This logic never adds any devices in production anyway because the zone image's config TOML never specifies any. The config TOML does specify the path to the bootrom the server should load (and an optional version string to display to the guest). Supply these arguments on the command line instead of getting them from the TOML. Once this is done, the config TOML in the zone image is unnecessary, so remove it.
- Loading branch information
Showing
18 changed files
with
91 additions
and
240 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,24 @@ | ||
# Propolis Server | ||
|
||
## Running | ||
|
||
Propolis is mostly intended to be used via a REST API to drive all of its | ||
functionality. The standard `cargo build` will produce a `propolis-server` | ||
binary you can run: | ||
|
||
``` | ||
# propolis-server run <config_file> <ip:port> | ||
``` | ||
|
||
Note that the server must run as root. One way to ensure propolis-server has | ||
sufficient privileges is by using `pfexec(1)`, as such: | ||
|
||
``` | ||
# pfexec propolis-server run <config_file> <ip:port> | ||
``` | ||
|
||
## Example Configuration | ||
This binary provides a REST API to create and manage a Propolis VM. It typically | ||
runs in the context of a complete Oxide control plane deployment, but it can | ||
also be run as a freestanding binary for ad hoc testing of Propolis VMs. | ||
|
||
**Note**: the goal is to move the device config from the toml to instead be | ||
configured via REST API calls. | ||
|
||
```toml | ||
bootrom = "/path/to/bootrom/OVMF_CODE.fd" | ||
## Running | ||
|
||
[block_dev.alpine_iso] | ||
type = "file" | ||
path = "/path/to/alpine-extended-3.12.0-x86_64.iso" | ||
The server requires a path to a [guest bootrom | ||
image](../propolis-standalone#guest-bootrom) on the local filesystem. It also | ||
must be run with privileges sufficient to create bhyve virtual machines. The | ||
`pfexec(1)` utility can help enable these privileges. | ||
|
||
[dev.block0] | ||
driver = "pci-virtio-block" | ||
block_dev = "alpine_iso" | ||
pci-path = "0.4.0" | ||
To build and run the server: | ||
|
||
[dev.net0] | ||
driver = "pci-virtio-viona" | ||
vnic = "vnic_name" | ||
pci-path = "0.5.0" | ||
```bash | ||
cargo build --bin propolis-server | ||
pfexec target/debug/propolis-server <path_to_bootrom> <ip:port> <vnc_ip:port> | ||
``` | ||
|
||
## Prerequisites | ||
|
||
When running the server by hand, the appropriate bootrom is required to start | ||
guests properly. See the [standalone | ||
documentation](../propolis-standalone#guest-bootrom) for more details. Details | ||
for [creating necessary vnics](../propolis-standalone#vnic) can be found there | ||
as well, if exposing network devices to the guest. | ||
|
||
## CLI Interaction | ||
|
||
Once you've got `propolis-server` running you can interact with it via the REST | ||
API with any of the usual suspects (e.g. cURL, wget). Alternatively, there's a | ||
`propolis-cli` binary to make things a bit easier: | ||
|
||
### Running | ||
|
||
The following CLI commands will create a VM, start the VM, and then attach to | ||
its serial console: | ||
|
||
``` | ||
# propolis-cli -s <propolis ip> -p <propolis port> new <VM name> | ||
# propolis-cli -s <propolis ip> -p <propolis port> state <VM name> run | ||
# propolis-cli -s <propolis ip> -p <propolis port> serial <VM name> | ||
``` | ||
The API will be served on `ip:port`. The easiest way to interact with the server | ||
is to use [`propolis-cli`](../propolis-cli), but you can also use tools like | ||
cURL to interact with the API directly. The server's OpenAPI specification is | ||
[checked into the repo](../../openapi/propolis-server.json). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.