OndrejHome / fast-vm

'fast-vm' is a script for defining VMs from images provided in thin LVM pool.
GNU General Public License v3.0
22 stars 14 forks source link

allow multiple VM numbers to be specified for some operations #26

Closed OndrejHome closed 6 years ago

OndrejHome commented 7 years ago

Idea: Allow for some common operations (start,stop,delete) to accept multiple VM numbers. For example: fast-vm start 50 51 52 (will start 3 VMs) Notes:

OndrejHome commented 7 years ago

Initial implementation with several operations converted is in 3ec0bdf6e3a0add72ef76f181f3c56d76244240d So far supported operations are: create, delete, start, stop, ssh, edit_note, resize, info

OndrejHome commented 6 years ago

edit_note operation needed additional fix to handle properly long argument - 7249ab1

OndrejHome commented 6 years ago

I have noticed a strange behaviour of this on my more powerful machine - usually when using the fast-vm in new terminal and trying action with multiple VMs some of them reports correct command to be executed but some of the check seems to be "bypassed" which results for example in attempt to stop already stopped VM or inability to detect properly the libvirt name of VM. This behaviour is not observed on a slower machine I have. Unless I figure out what I'm hitting here I would consider some workaround like delaying the multiple operations to not start running concurrently on exactly same time.

OndrejHome commented 6 years ago

ok, on one machine that I have I think I got some sort of reproducer. It seems that virsh list ... run in parallel seems to sometimes return empty list of VMs. Not sure if this give non-zero exit code, but sure that fast-vm code is not checking this. This seems to get visible when multiple operations are executed at same time. Got few outputs that suggests that some checks (involving virsh list ...) succeeded and later we didn't get value where expected (typically $vm_name executing virsh list ... was missing output) so the commands that expected value to be there failed. Long story short: TODO - implement checks of outputs when using virsh to get data. Verify that virsh doesn't fail there before using data from it.

OndrejHome commented 6 years ago

unable to reproduce the issue even when stressing my machine a lot leads me to leaving this for now in current state. In most cases this works well and issue never appeared on my other machine.

OndrejHome commented 6 years ago

multiple operations are now in 1.3 release. closing