A utility to manage SmallStack Hypervisors.
The hyper-control utility manages Hypervisors. It is typically run on a desktop or bastion machine. Please read the SmallStack design document to understand the architecture.
hyper-control supports several sub-commands. There are many
command-line flags which provide parameters for these sub-commands. The
most commonly used parameters are -fleetManagerHostname
or
-hypervisorHostname
which specify either the Fleet Manager
or a specific Hypervisor
to communicate with. At startup, hyper-control will read
parameters from the ~/.config/hyper-control/flags.default
and ~/.config/hyper-control/flags.extra
files. These are
simple name=value
pairs. The basic usage pattern is:
hyper-control [flags...] command [args...]
Built-in help is available with the command:
hyper-control -h
Some of the sub-commands available are:
The Hypervisor
restricts RPC access using TLS client authentication.
hyper-control will load certificate and key files from the
~/.ssl
directory. hyper-control will present these
certificates to the Hypervisor (or Fleet Manager). If
one of the certificates is signed by a certificate authority that the
Hypervisor trusts, the Hypervisor will grant
access.
The hyper-control tool may be used to install Hypervisors (OS+Hypervisor) on physical machines. This requires that information about machines and subnets is recorded in the topology (usually in Git), which is obtained from the Fleet Manager. Hypervisors may be installed by PXE booting an installer, booting from a custom ISO image or installing over a running system. Please read the Machine Birthing design document which describes the principles of installing physical machines.
This is the most common method of installing. If there is at least one working Hypervisor on the same subnet, you can PXE (network) boot. The hyper-control tool is used to automatically select a Hypervisor to configure as a PXE server (it creates a temporary DHCP lease and will serve configuration files via TFTP).
The following options must be provided:
-fleetManagerHostname
-imageServerHostname
-installerImageStream
You may want to increase the -netbootTimeout
option if
the machine takes a long time to boot. Run the following command:
hyper-control netboot-host $target_host
Then, initiate a PXE boot for the target machine. It should boot the installer image, configure and install the machine and then reboot into the new OS. In principle, multiple machines can be installed in parallel, one machine for each time the above command is run.
The content for the TFTP files containing the OS loader and netboot
OS is fetched from the installer image configured in the Hypervisor. The default OS
loader is pxelinux.0
. Configuration data for the machine is
sent to the Hypervisor
and will be available via TFTP. See the installer documentation for
details on the configuration files.
If there is no working Hypervisor on the subnet and if there is no DHCP relay configured to forward DHCP requests to a Hypervisor on another subnet, then another option is to install the machine using a custom ISO (CD-ROM) image. The ISO image can be written to a CD-ROM, a USB memory drive or served by a NFS/SMB server (this requires that the machine BIOS supports booting from remote media).
As above, the same required options must be provided. The following command will generate a custom ISO image for the target machine. Note that the networking configuration for the machine is baked into the ISO, so the ISO is only good for one machine.
hyper-control make-installer-iso $target_host $destdir
This will create a custom ISO for this machine in the specified directory, with both hostname and IP address file entries.
If there is a Linux OS already installed and running on a machine,
you can use the hyper-control utility to install a new
OS+Hypervisor. This uses the kexec
utility to boot directly
into the new kernel, skipping the BIOS. This is a good way of wiping and
getting a fresh install.
As above, the same required options must be provided. Run this command:
hyper-control reinstall
This method is much faster, since it skips rebooting via the BIOS the first. Remember: it wipes all data on the machine!
Upgrading Hypervisors is done using the
hyper-control tool. This sets the RequiredImage
tag on Hypervisors in the specified location. The rollout is
controlled, starting slow and gaining speed as Hypervisors
complete upgrades and remain healthy. The upgrade may include a new
kernel, in which case the machine will be rebooted as part of the
upgrade, thus taking several minutes for the per-machine upgrade+health
check cycle to complete (compared to less than one minute for most
upgrades). The actual upgrades are performed by the dominator which reads the tags to
determine the image to push to the machine. Once the rollout is
complete, the new tags are saved by committing to the Git repository
containing the topology.
The following options must be provided:
fleetManagerHostname
imageServerHostname
location
topologyDir
To rollout a new Hypervisor image to all the Hypervisors in the specified location, run a command like this:
hyper-control rollout-image $image_name