summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-03-06 14:19:55 +0000
committerLars Wirzenius <liw@liw.fi>2021-03-06 14:19:55 +0000
commita6f802fda57fc7e951c0374a268de2274718cd9d (patch)
treef9bd0122e68e29479f092fc7732ece9afeecbc2c
parent7f063f5a05bd9ac21a5679901c2f5bc5851a3cfb (diff)
parent7a19757db8eabe7aaab84e8f1dd08373f8667c0d (diff)
downloadvmadm-a6f802fda57fc7e951c0374a268de2274718cd9d.tar.gz
Merge branch 'README' into 'main'
doc: add README See merge request larswirzenius/vmadm!10
-rw-r--r--README.md77
1 files changed, 77 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..9408291
--- /dev/null
+++ b/README.md
@@ -0,0 +1,77 @@
+# vmadm README
+
+vmadm is a tool to create and destroy virtual machines running
+under a local libvirt. Virtual machines are described in specification
+files, using YAML:
+
+~~~yaml
+foo:
+ cpus: 4
+ memory_mib: 4096
+ image_size_gib: 100
+
+bar:
+ cpus: 1
+ memory_mib: 512
+ image_size_gib: 1
+~~~
+
+All the machines in a specification file are created or destroyed at
+once.
+
+## Usage
+
+Given a specification file `machines.yaml`, to create virtual machines
+run:
+
+~~~sh
+$ vmadm new machines.yaml
+~~~
+
+To delete them:
+
+~~~sh
+$ vmadm delete machines.yaml
+~~~
+
+Creating a VM creates a disk image of qcow2 format, based on a base
+image, also of qcow2 format. Deleting the VM deletes the image file as
+well. Image files are named after the VM and put into the configured
+image directory, unless the specification file names an image file
+explicitly.
+
+To get built-in command line help:
+
+~~~sh
+$ vmadm help
+$ vmadm --help
+~~~
+
+## Configuration
+
+The default configuration file is `vmadm/config.yaml` under the XDG
+configuration directory; by default, this is
+`~/.config/vmadm/config.yaml`. The configuration file may specify the
+following fields:
+
+* `default_base_image` &ndash; path to the base image to use by default
+* `default_image_gib` &ndash; default size of new image for a VM, in GiB
+* `default_memory_mib` &ndash; default amount of memory for a VM, in MiB
+* `default_cpus` &ndash; default number of CPUs for a VM
+* `image_directory` &ndash; directory where VM image files are put
+* `authorized_keys` &ndash; list of filenames to SSH public keys, to
+ be put into the default user's `authorized_keys` file in the VM
+
+## Specification fields
+
+The specification file is YAML and may specify the following fields,
+all of which override some default from the configuration.
+
+* `ssh_key_files` &ndash; overrides `authorized_keys`
+* `image_size_gib` &ndash; overrides `default_image_giv`
+* `memory_mib` &ndash; overrides `default_memory_mib`
+* `cpus` &ndash; overrides `default_cpus`
+* `base` &ndash; overrides `default_base_image`
+* `image` &ndash; overrides default image file name; must include
+ pathname, is not put into the image directory by default
+