krystal / katapult-cli

CLI tool to interact with Katapult API
MIT License
1 stars 1 forks source link

Virtual machine builder #19

Closed adamcooke closed 3 years ago

adamcooke commented 3 years ago

One of the most complicated parts of the CLI is going to be the UI for building a new virtual machine. This needs to be really nice to use.

Building a virtual machine is bloody complicated and has lots of options that the user can configure. Whether we want to support all of these in the UI will come down to striking a balance between complexity and flexibility.

To begin, we should focus on an interactive mode for creating VMs. The mode will need to ask a series of questions (some of which having selections, some text input etc...), the build an appropriate build spec and ship that off to the API.

(It would actually be really nice to have a mode in the CLI that runs through the wizard but just spits out the build spec at the end rather than actually sending it to the API. Some sort of "preview".)

The question that need to be asked are likely to be very similar to the flow that exists in the current UI and of the new UI.

Screenshot

To simplify this for an initial version, let's do the following:

  1. Choose a data center (basically a list to choose from which will need to be looked up in the API)

  2. Choose a package (they need to choose which package to use, there are lots of packages so this may need some clever fuzzy searching to allow searching for a specific size). We also need to support flexible resources. I'd suggest we have a flag that can be passed to the command (--flexible) which will instruct it to ask for a quantity of memory and CPU cores rather than even use the package selector.

    Which ever option is chosen, we also need to ask for a size for the system disk.

  3. Choose a template (as above, there could be quite a few so needs a good fuzzy search). There should also be an option to use no template.

  4. Ask for hostname, name, group, description, tags etc...

There are other things we can do which will need to be integrated eventually somehow. We ultimately want to support using any part of the build spec (linked above).