[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.

Welcome to the Slackware Documentation Project

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
howtos:emulators:helper_script_for_managing_qemu_virtual_machines [2016/09/04 20:04 (UTC)] – [Problems] louigi600howtos:emulators:helper_script_for_managing_qemu_virtual_machines [2023/12/12 08:13 (UTC)] (current) – [Sources] zeebra
Line 1: Line 1:
-====== Preface ======+====== Helper script for managing QEMU virtual machines ====== 
 +<!--I took the liberty to fix this headline, if it should have another name, change it  --- //[[wiki:user:zeebra|zeebra]] 2023/12/12 08:11 (UTC)// --> 
 +===== Preface =====
 Qemu is a popular and powerful open-source emulator often used for running KVM Virtual Machines (VMs). In fact qemu supports emulating so many things that it can be quite challenging, unless you do it very often, to manually start a VM from a text console. Who would want to write the below command for starting a VM ? Qemu is a popular and powerful open-source emulator often used for running KVM Virtual Machines (VMs). In fact qemu supports emulating so many things that it can be quite challenging, unless you do it very often, to manually start a VM from a text console. Who would want to write the below command for starting a VM ?
  
Line 25: Line 27:
  
 ====== Proposed Solution ====== ====== Proposed Solution ======
-It quickly became apparent to me that the VM configuration would need to be generated rather then manually created and that a central configuration repository would much aid the process. Again a text based central configuration file would make the code in inherently complicated (having to deal with an arbitrary number of VMs each with arbitrary number of disks and NICs).  +It quickly became apparent to me that the VM configuration would need to be generated rather then manually created and that a central configuration repository would much aid the process. Again a text based central configuration file would make, either the code or the config file, inherently complicated (having to deal with an arbitrary number of VMs each with arbitrary number of disks and NICs).  
-Having some experience on database administration made it a little unappealing to use LDAP for central repository and even if I had no DB experience at all I doubt I'd actually want the overhead of running LDAP just for this. Running MariaDB or Postgres for the same reason was rather unappealing toofor my small requirements, so I chose to use sqlite3. In my case it would be extremely rare that, 2 or more simultaneous executions of the management script, make a mess on the DB but if you have several people managing creating or deleting VMs you might want to opt for MariaDB or Postgres.+Having some experience on database administration made it a little unappealing to use LDAP for central repository and even if I had no DB experience at all I doubt I'd actually want the overhead of running LDAP just for this. Running MariaDB or Postgres was equally unappealing too for my small requirements, so I chose to use sqlite3. In my case it would be extremely rare that, 2 or more simultaneous executions of the management script, make a mess on the DB but if you have several people managing creating or deleting VMs you might want to opt for MariaDB or Postgres. 
 + 
 + 
 +Another thing that quickly became apparent was the almost repetitive code required to prompt for all the options so I decided to address that in 2 ways: 
 +  - have as much of the promoting automatically generated with a clever workaround 
 +  - use dialog to further simplify the UI for prompting
  
-Another thing quickly became apparent was that a lot of code was required to prompt for all the options on the text console. I find that dialog can be really handy for this along with making a better appealing interface. 
  
 ===== Basic Configuration ===== ===== Basic Configuration =====
-To get better flexibility to where things are stored it's a good idea to have a basic configuration file that tells the management script there the important things are:+To get better flexibility for configuring where things are stored it's a good idea to have a basic configuration file that tells the management script where the important things are:
   * Path to folder that will contain all the VMs   * Path to folder that will contain all the VMs
   * Path to where the centralized VM configuration DB is   * Path to where the centralized VM configuration DB is
 howtos:emulators:helper_script_for_managing_qemu_virtual_machines ()