![]() Here's what the data inside my configuration database looks like:ġ|ORACLE|qemu-system-i386|pc|kvm32|1024|en-us|file=/usr/share/qemu/bios.bin|c|1|vnc|ciccio|1|||Ģ|test|qemu-system-i386|pc|kvm32|1024|en-us|file=/usr/share/qemu/bios.bin|c|1|vnc|ciccio|1|||ģ|ORACLE2|qemu-system-i386|pc|kvm32|1024|en-us|file=/usr/share/qemu/bios.bin|c|1|vnc|ciccio|1|||Ĥ|freenas|qemu-system-x86_64|pc|host|3000|en-us|file=/usr/share/qemu/bios.bin|c|1|vnc|pafutometu|1|||ĥ|armedslack|qemu-system-arm|versatilepb||256|en-us|||0|vnc|cicciobello|1|/VM/armedslack/zImage-versatile|/VM/armedslack/initrd-versatile|root=/dev/sda1 rootfs=ext2 This is what it would be like to get propted (with defaults) for the missing basic configuration: If you need to add another basic configuration option it's really fast … and as long as you give them names that speak for themselves it will also be easy to give them values when prompted via dialog. Isn't that nice? there's no specific code for each basic configuration option … everything is self generated from the SCRIPT_PARAMS variable. SCRIPT_PARAMS="VM_PATH VM_DB ISO_PATH MONITOR_START_PORT SHUTDOWN_TIMEOUT OS_RESERVED_MEM" I do this by using the make_config finction to which I refer th the above paragraph and a variable that holds the mandatory parameter list (there are also 2 function for manipulating input and generating a dialogs based on the input form_dialog and accept_dialog ): Getting someone to use your script if it's difficult to configure is difficult so I opted for having the script prompt the user for it's mandatory configuration options and automatically create the basic configuration file if it's not there. 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.Īnother 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: Running MariaDB or Postgres was equally unappealing too for my small requirements, so I chose to use sqlite3. 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. ![]() 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). 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. It's likely that someone else has done this and a lot better then me but nevertheless I'd still like to hare with you the route I took. I'd like to share my experience in doing so without presumptuously declaring that I do this any better then anyone else, letting you decide what's good or bad for your needs. Over the years I've radically changed the helper script form having text configuration files for each VM to a centarl VM configuration database. Personally I chose to manage my VMs from text console because for me it's an added value to be able to do such jobs even without GUI, so possibly like many others I wrote my onw scripts for managing my qemu VMs. If you want an easy way out you might consider virtmanager or something like that. ![]() Is is common, for people running qemu VMs, to use some sort of software for creating, running and maintain the VMs. Not everyone might want console redirect on vnc and monitor redirect via telnet but non the less that's still a relatively small subset of the options supported by qemu-system-arm and only has one disk one cdrom and one Network Interface Controller ( NIC) so things can be much worse then this. Qemu-system-arm -name armedslack -M versatilepb -m 256 -k en-us -vnc :5,password -usb -kernel /VM/armedslack/zImage-versatile -initrd /VM/armedslack/initrd-versatile -append 'root=/dev/sda1 rootfs=ext2' -monitor telnet:127.0.0.1:1035,server,nowait -drive file=/VM/armedslack/qemu_hdu.raw,index=0,media=disk -drive file=,index=1,media=cdrom -net nic,macaddr=52:54:57:c0:2c:bb -net tap,ifname=tap5 Who would want to write the below command for starting a VM ? 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. Qemu is a popular and powerful open-source emulator often used for running KVM Virtual Machines (VMs). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |