Make and manage copy-on-write KVM clones from template VMs
Go to file
Jesse Gardner 939da1ba68 minor changes to README 2021-04-17 17:43:11 -07:00
LICENSE qq2clone V 0.1.0 2021-04-12 19:20:38 -07:00
README.md minor changes to README 2021-04-17 17:43:11 -07:00
lv_api_do integrated lv_api_do into qq2clone for load_template 2021-04-12 19:22:11 -07:00
lv_api_do.c integrated lv_api_do into qq2clone for load_template 2021-04-12 19:22:11 -07:00
man.md modified and improved documentation 2021-04-15 17:04:09 -07:00
man.pandoc modified and improved documentation 2021-04-15 17:04:09 -07:00
pandoc_gen_docs more documentation 2021-04-12 19:22:11 -07:00
qq2clone Not sure why open_pipe made a temp directory, now it makes a temp file instead 2021-04-15 19:21:53 -07:00
qq2clone.1 modified and improved documentation 2021-04-15 17:04:09 -07:00
qq2clone.completion Updated completion script 2021-04-15 17:44:09 -07:00

README.md

README

qq2clone is a linux tool to simplify creating and managing copy-on-write clones of template QEMU/KVM virtual machines. It can perform batch operations in case you are working with multiple clones. For much more information, there is a markdown version of the manual page you can read above (man.md).

qq2clone has these dependences:

  • virsh (qq2clone has started the transition to use the libvirt API directly, this will not remain a dependency forever)
  • Bash 4.0+
  • sqlite3
  • xmllint (from libxml2)
  • qemu-img
  • libvirt tools:
    • virt-clone
    • virt-xml
    • virt-xml-validate

INSTALL

Eventually I will write an install script, but for now the process is manual.

First, download the main script (qq2clone) and place it somewhere in your path. Make it executable.

Second, qq2clone requires a directory it will use to store its sqlite database, helper application, template XML and default storage pool. The default value for this directory is ~/storage-qq2clone. If you want to use a different location, create the file ~/.config/qq2clone and place the absolute path to the directory of your choice in that file. Then create the directory ~/storage-qq2clone (or whatever you chose), and download lv_api_do into that directory. Make it executable.

Lastly, there is a bash completion file (qq2clone.completion) and a man page (qq2clone.1) above.

That's it!

FAQ

Is this really 3000 lines of Bash? In 2021?!

Yep! I am aware that more popular, modern scripting languages like Python exist, but Bash is more than sufficiently capable for a project of this nature. The reason I chose it specifically was as an opportunity to further develop my Bash skills. Similarly, the lv_api_do helper application is written in C rather than Python (for which libvirt API bindings exist) because I hadn't written any C in a long time and it was an opportunity to re-familiarize myself with the language.

EXAMPLES

TODO: I will flesh out this section later, for now check out the examples section in man.md