kiss-configure - configuring VMs
See the design document for background.
Overview
The configuration is kept in a pair of git repositories on the cluster
nodes. You should only ever work on the "primary" node, that is, the
first one in the cluster_members
list.
VMs are defined via YAML files in
/srv/kiss-configure/vm-config/cluster_name/
, and the configuration
is then applied to the nodes by running kiss-configure
in
/srv/kiss-configure
.
These steps lead to a VM that's ready to be started (but has no operating system).
The VM configuration file looks like this:
name: vm1
primary_on: node1
network_bridge: br0
ram_megs: 512
root_disk_size: 10G
cpus: 2
more_disks:
- name: var
size: 100G
name
name
is the name of the VM. It is used in
the logical volume names as
NAME_root
the systemd unit file as
vm-NAME.service
the DRBD resource as
NAME
There is no support for changing names automatically. Choose one, stick with it, or rename all the stuff manually.
primary_on
primary_on
gives the node name where the VM normally runs.
network_bridge
We only support one network interface per VM; it is connected to a
bridge on the host, and this is the name of that bridge. The bridge
itself has to be created in the system configuration (look at
/etc/network/interfaces
on an installed cluster member for how
that's done).
So on a cluster connected to a trunk port, you'd create a bridge for each VLAN of interest, and then assign them to the VMs.
ram_megs
This is obvious, or is it?
root_disk_size
Each VM has at least one virtual disk, backed by volume 0 in a DRBD
resource with the same name as the VM. That resource in turn is backed
by the logical volume vmvg/NAME_root
. root_disk_size
is used
when creating that LV, so you can use any size modifier that lvm (or
rather, ansible's "lvol" module) accepts.
cpus
The number of virtual CPUs to provide to the VM.
more_disks
This is an optional item; it contains a list of up to three additional virtual disks for the VM, each with a name and a size.
Those disks are taken in the order they appear and added to the DRBD
resource starting at volume 1 (so changing their order will lead to
bad things). They are backed by LVs named vmvg/VMNAME_DISKNAME
,
and the size
parameter is treated like root_disk_size
.
Starting a VM, and tools
systemctl start vm@NAME
Alternatively, there's a script kiss-boot-iso
that can be run for
a temporary boot with an ISO file in the virtual CD drive. Run it like
kiss-boot-iso NAME ISO-FILE
Of course, the VM must be stopped beforehand.
Or, you can attach an ISO file to a running VM via
kiss-vm-monitor NAME iso NUMBER ISO-FILE
and detach it with
kiss-vm-monitor NAME iso NUMBER
where NUMBER is the number of the virtual CD drive, 0 or 1 (you may need two for windows installation with virtio drivers).
kiss-vm-monitor
also has a powerdown
and a reset
option.