aboutsummaryrefslogtreecommitdiffstats
path: root/vm/vmm
Commit message (Collapse)AuthorAgeFilesLines
* vm: add context to Pool.Create()Aleksandr Nogikh2025-10-011-1/+1
| | | | | | | | | | Enable external abortion of the instance creation process. This is especially useful for the qemu case where we retry the creation/boot up to 1000 times, which can take significant time (e.g. it timeouts syz-cluster pods on unstable kernels). The context can be further propagated to WaitForSSH, but that requires another quite significant vm/ refactoring.
* vm: func Run accepts contextTaras Madan2025-05-191-4/+3
| | | | It allows to use context as a single termination signal source.
* vm: use SSHOptions instead of 4 paramsTaras Madan2025-03-271-26/+25
| | | | It reduces WaitForSSH parameter count from 9 to 6.
* vm: dedup VM count restriction in debug modeDmitry Vyukov2024-11-251-4/+0
| | | | | | | Move the VM count restriction logic info vm package. This avoids lots of duplication, makes it supported for VM types that failed to do this, and allows to unify more VM count logic in future.
* vmimpl: refactor VM type registrationDmitry Vyukov2024-07-231-1/+4
| | | | | | | | | Pass Type struct directly during registration. This allows to add additional optional parameters to VM types without changing all VM implementations. We we will need to add SupportsSnapshots flag and one flag to resolve #5028. With this change it will be possible to add "SupportsSnapshots: true" to just one VM type implemenetation.
* vm: make Instance implement io.CloserAleksandr Nogikh2024-07-111-1/+2
| | | | It's better to follow standard interfaces.
* pkg/rpctype: prepare for not using for target communicationDmitry Vyukov2024-05-031-1/+1
| | | | | | Remove things that are only needed for target VM communication: conditional compression, timeout scaling, traffic stats. To minimize diffs when we switch target VM communication to flatrpc.
* pkg/rpctype: make RPC compression optionalDmitry Vyukov2024-04-031-1/+1
| | | | | | | | RPC compression take up to 10% of CPU time in profiles, but it's unlikely to be beneficial for local VM runs (we are mostly copying memory in this case). Enable RPC compression based on the VM type (local VM don't use it, remove machines use it).
* vm/isolated: allow the use of system-wide SSH configFlorent Revest2024-03-191-3/+3
| | | | | | | | | | | | Most of the VM types tightly manage the target they SSH into and can safely assume that system wide SSH configuration would mess with the SSH flags provided by syzkaller. However, in the "isolate" VM type, one can connect to a host that is not at all managed by syzkaller. In this case, it can be useful to leverage system wide SSH config, maybe provided by a corporate environment. This adds an option to the isolated config to skip some of the SSH and SCP flags that would drop system wide config.
* all: use special placeholder for errorsTaras Madan2023-07-241-1/+1
|
* vm: separate boot time and infrastructure errorsAleksandr Nogikh2023-05-091-2/+8
| | | | | | | | | | | | | | | It's not correct to mix them since they point to fundamentally different issues: 1) Boot time errors are caused by a problematic kernel image and can only be resolved by using another kernel version or config. 2) Infrastructure errors are temporary, so we can just try again some time later. Reserve the existing BootError for (1) errors and let all other VM handling errors refer to (2). To make it possible to attach more output to the infra error, introduce the VerboseInfraError type.
* vm/vmm: adapt to recent vmctl changesGreg Steuck2023-04-261-53/+30
| | | | | | | | | | | The flags now must precede the VM id. The IP address can no longer be determined by looking at the VM output which was previously possible due to dhclient printing it. Now that we don't have dhclient we instead look up the VM id in vmctl status output and the VM IP uses a fixed pattern. With the two changes I can run syz-manager and it gets far enough to report missing coverage.
* vm: pass Report to DiagnoseDmitry Vyukov2020-11-211-1/+2
| | | | | | | | | The way to diagnose generally depends on the issue. E.g. do we need register dump to debug this issue? Do we need host dmesg dump? Some diagnosis may be directly specific to a particular problem (e.g. dumping a particular debugfs/procfs file). Pass Report to Diagnose to make this possible.
* vm/vmimpl: refactor DiagnoseFree/OpenBSDDmitry Vyukov2020-03-211-1/+1
| | | | | Make signatures of these functions match vm.Diagnose. Both more flexible, less code, more reasonable.
* vm/qemu: detect boot errors fasterDmitry Vyukov2019-03-171-1/+1
| | | | | | | | | Currently we try to ssh into the machine for 10 minutes even if it crashed right away. Make qemu exit on kernel panic and stop ssh'ing when qemu exits. Handling bad kernels fast is actually important for bisection. Update #501
* vm: allow Diagnose to directly return diagnosisMichael Pratt2018-12-211-2/+2
| | | | | | Rather than writing the diagnosis to the kernel console, Diagnose can now directly return the extra debugging info, which will be appended ot the kernel console log.
* vm/gce: use openbsd console diagnostic code for both vmm and gceGreg Steuck2018-12-021-17/+1
| | | | | | | | * openbsd: use console diagnostic code for both vmm and gce. * gometalinter wants less indentation and more stuff in scope * Comment no longer applies
* vm/qemu: improve debug outputMichael Tüxen2018-11-301-1/+2
| | | | | | | | | | | | | | | | | | | | | | * vm/qemu: Improve debug output. When running in debug mode, the number of VMs is reduced to 1. State this in the debug output. * vm/qemu: Don't start debug output with a capital letter. As requested by Dimitry. * vm: Provide debug message when reduing number of VMs. Apply this change to all affected platforms for consistency. Suggested by Dmitry. * Add myself to AUTHORS/CONTRIBUTORS files. * vm: Fix compilation issues missed in earlier commit. * vm: Use logging to write debug message.
* openbsd: run on gceGreg Steuck2018-11-271-8/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * build/openbsd: minor cleanup (use tuples instead of maps) * Grammar nits in comments. * Simplify openbsd.Create, will defer when there's more than one error exit. * pkg/build: Support copying kernel into GCE image * Simple test for openbsd image copy build. * Cleanup in case something failed before. * Support multi-processor VMs on GCE. * More debug * Reformat * OpenBSD gce image needs to be raw. * GC * Force format to GNU directly on Go 1.10 or newer. * Use vmType passed as a parameter inside openbsd.go * gofmt * more fmt * Can't use GENERIC.mp just yet. * capitalize * Copyright
* openbsd: include process information into crashesGreg Steuck2018-11-211-0/+2
|
* vm/vmm: make sure to always end ddb commands with a newlineAnton Lindqvist2018-11-151-5/+5
| | | | Missed one in my previous commit.
* vm/vmm: disable pagination and show panic in Diagnose()Anton Lindqvist2018-11-121-1/+8
| | | | | | The ddb(4) debugger defaults to showing 24 lines at a time, the next chunk of lines will be displayed only after receiving keyboard input. Setting maxlines to 0 disables pagination completely.
* vm/vmm: use derived disks for VMsAnton Lindqvist2018-10-111-6/+9
| | | | | | | | As a result, the boot time is significantly improved since there's no longer any need to copy the complete disk. This feature was recently committed to OpenBSD-current. Any existing base image used must be recreated, this time using the qcow2 disk format.
* vm/vmm: recover from vmctl errors fasterDmitry Vyukov2018-09-201-6/+14
| | | | | | | | | vmctl start periodically fails with: vmctl: start vm command failed: Operation already in progress So try to sleep for a bit after vmctl stop. And detect when vmctl start terminates prematurely to avoid 10 minute timeout for ip extraction.
* vm/vmm: don't start separate process for consoleDmitry Vyukov2018-09-201-98/+60
| | | | | | | | | | | | | | vmctl console fails from time to time with: vmctl: console not found Probably there is some race (most of these things assume that there is a human typing commands with delays). Also, vmctl start can connect to console itself with -c flag. So use that because it both solves the console race and also makes code much more similar to other VM implementations (qemu, gvisor). This also eliminates 3 additional goroutines per VM.
* vm/vmm: fix fd leaksDmitry Vyukov2018-09-201-1/+6
| | | | | Close pipe fd's on failure paths. Don't close outr because OutputMerger closes all passed in fd's.
* vm/vmm: increase timeoutsDmitry Vyukov2018-09-201-5/+5
| | | | | | | | | A dozen of vmm's running on a GCE machine can be really slow to boot. Timeouts have only single goal: preventing complete system stalls when/if external commands episodically hang. There is no value in keeping them as close as possible to expected durations. This can only lead to various flakes. Increase timeouts by an order of magnitude.
* vm/vmm: properly shutdown output reading goroutineDmitry Vyukov2018-09-201-0/+1
| | | | | | | The goroutine sends on bootOutputStop to notify about its completion, but the main goroutine is not receiving from the chan on success and since the chan in unbuffered, the output reading goroutine hangs on the send forever.
* vm/vmm: make more robust after restartsDmitry Vyukov2018-09-201-0/+1
| | | | | Instances from the previous run can still be running, so always stop the previous instances before starting new ones.
* vm/vmm: don't prefix vm name with syzkallerDmitry Vyukov2018-09-201-1/+1
| | | | | | | | | | I am getting: failed to run vmctl -name syzkaller-ci-openbsd-main-test-0 vmctl: name too long The name is auto-generated from parts which ensure that it is unique. We can't easily name it shorter. So strip the syzkaller prefix, which is not strictly necessary.
* vm/vmm: remove cpu parameter, make template optionalDmitry Vyukov2018-09-201-9/+3
| | | | | CPU is not used. Remove it. Template is not strictly necessary. Make it optional.
* vm/vmm: increase maximum number of VMsDmitry Vyukov2018-09-201-2/+2
| | | | | 8 is way too low. A modern beefy machine can host a hundred of VMs freely. Make the limit consistent for all of qemu/kvm/gvisor/vmm and set it to 128.
* vm/vmm: enable networkDmitry Vyukov2018-09-171-0/+1
| | | | | | | Without -L local interface vio0 is not enabled and we can't connect to the machine. Update #712
* syz-ci: de-hardcode list of VMs that support overcommitDmitry Vyukov2018-09-111-1/+1
| | | | | | | | We currently have this list in multiple places (somewhat diverged). Specify this "overcommit" property in VM implementations. In particular, we also want to allow overcommit for "vmm" type. Update #712
* vm/vmm: fix IP address detectionAnton Lindqvist2018-08-291-36/+38
| | | | | | | | The IP address of a VM is calculated based on the formula 100.64.X.3 where X being the ID of the VM, starting from 0. After starting 256 VMs 64 will flip over to 65 and so on. A more robust solution to calculating the IP is to simply read it from output during boot. While here, stop using the VM ID as the identifier since the VM name also works.
* vm/vmm: support for vmm found on OpenBSD (#678)Anton Lindqvist2018-08-181-0/+376
vm/vmm: add vmm implementation found on OpenBSD