- use builtin vm list to dynamically generate distros
- use builtin vm list to add custom distros in the .kivrc file
- support for --arch; add x86_64 and aarch64 default qcow2 images
- remove support for end of life distros
- support set -euo pipefail
- some shellcheck cleanups
- remove ISO generation in favour of --cloud-init flag
- add timeout when waiting for MAC address
- set default distro to rocky9
- bump default memory to 1536MB to support newer distributions
* Add command wrapper for verbose mode
Add a wrapper function to automatically print command arguments when
running in verbose mode. Currently, this is only done for the `virsh
pool-create-as` and `virt-install` commands, but more commands could
be added in the future.
Having the wrapper run the command removes the redundant command
arguments and will allow us to more easily support a variable number
of virt-install arguments
This commit introduces the following shell helper functions:
join Join strings into a single string, joined
by a delimiter.
output_command Print the command arguments for verbose mode,
formatted as one argument per line, with line
continuation characters as needed.
run Command execution wrapper to print the command
when running in verbose mode and to redirect
output to the current log file.
* Support virt-install graphics auto-detection
Typically, the `virt-install` user does not need to specify the
--graphics option. When the --graphics flag is not specified,
virt-install will try and choose a useful default and launch a suitable
connection.
Support graphics auto-detection by omitting the virt-install --grahics
option when the kvm-install-vm '-g' flag is set to 'auto' or the
GRAPHICS variable in the ~/.kivrc file is set to 'auto'.
* Hypervisor custom parameters
Support custom virt-install parameters for advanced usage. This allows
for advanced customization and to support Xen and other non-KVM
hypervisors.
Users may specify hypervisor specific settings in the $HOME/.kivrc
customization file, without resorting to patching kvm-install-vm.
With this change, none of the virt-install parameters are hardcoded in
the script, values may be specified to be empty to avoid setting a given
parameter, and additional options may be provided as needed.
This commit adds the following custom virt-install options:
NETWORK_MODEL --network model value (default: virtio)
NETWORK_EXTRA extra --network options
DISK_BUS --disk bus type (default: virtio)
DISK_EXTRA extra --disk parameters
CI_ISO_DEVICE ci cdrom device type (default: cdrom)
CI_ISO_EXTRA extra ci cdrom parameters (default: "")
GRAPHICS_LISTEN --graphics listen value (default: localhost)
GRAPHICS_EXTRA extra graphics parameters
VIRT_INSTALL_EXTRA extra virt-install options
The following virt-install options are dependent on the image being
installed, and so are determined the value of -t command line option.
OS_TYPE --os-type (currently always "linux")
DISK_FORMAT --disk format (currently always "qcow2")
Having seperate directories makes it easier to work multiple images and vms.
This change keeps the current image storage location as ~/virt/images but
moves the domains under the ~/virt/vms directory.
Also adds the -L switch to customize the VM storage location.
* Add check for bridge status file and assume it's a layer 2 bridge if it doesn't exist
* Move known_hosts check inside if condition
* Formatting
* Initial commit for custom runcmd support
* Add r as supported option
* Add option for graphics type
* Quotes
* No autoport with this version of virt-install
* Add listen
* Add option to customize additional user
* Custom port support for graphical console
* Fix typos
* Add verbosity to help
* Fix README text
* Unnecessary quotes
* Add workaround for VNC port number
* Load IMAGEDIR for bats tests, increase sleep before hostname resolution test, fix DISKDIR used by attach-disk function
* Make VM name unique to avoid issues with stale libvirt-nss hostname resolution
* Only set VMNAME if it's not already set
* Missing quote
* Export VMNAME
* Increase sleep to 45 seconds
* Add centos user to ssh command
* Fix description of attach-disk
* Change user-data to multipart MIME archive to allow inclusion of a shell script instead of additional runcmd items fs
* Fix boundary
* Remove comment line I never filled in
* Fix typo
* Fix typo and missing colon
* Add autostart option
* Handle output of autostart
* Redirect
* Use outputn
* Add -a to valid options