summaryrefslogtreecommitdiffstats
path: root/usr.sbin/vmctl (follow)
Commit message (Collapse)AuthorAgeFilesLines
* fix spelling of IMSG_VMDOP_TERMINATE_VM_RESPONSE in commentjasper2020-03-111-2/+2
| | | | from Matt Schultz
* Backout "DHCP is configured on the first interface only"kn2020-02-161-3/+3
| | | | | | | | | | | | | | | | | I completely missed that part from vmctl.5's "LOCAL INTERFACES" section. Reading `-L's description itself and the fact that it functions as a boolean switch contrary to how `-i' expects a number, I made the wrong assumption that it can only work for the first interface. "vmctl -Li2" configures two interfaces, one witch DHCP and one without. "vmctl -L -L" however configures two interfaces with DHCP IPs each. My second mistake was to imply analogue behaviour for the configuration. Now that you stated the obvious about `local' being per `interface' line, it makes absoloutely no sense to above mentioned behaviour for static VM definitions. Pointed out by tb
* DHCP is configured on the first interface onlykn2020-02-151-3/+3
| | | | | | | A VM can have multiple interfaces, but only the first one gets DHCP if "-L" (vmctl) or "local" (vm.conf) is specified. Positive feedback Mike Larkin
* vmctl(8): fix vmctl send exit codepd2020-01-031-1/+2
| | | | | | | vmctl send always returned exit code 1 Patch by Benjamin Baier ok kn@
* Run cu(1) in restricted modekn2019-12-281-2/+3
| | | | | | | | | | | Users must not not be able to transfer files from the local hypervisor filesystem to VMs/LDOMs, especially since the "vmctl/ldomctl console ..." might be run as root. Disable all relevant escape sequences and cause cu to run under "stdio tty" pledge by using -r. OK deraadt mlarkin
* Use local variable isntead of function parameterkn2019-12-172-6/+8
| | | | | | | | | | The parse_size() wrapper around scan_scaled(3) writes its intermediate result to the function argument which is always passed as literal zero. This seems odd, the function parameter has no meaning but merely serves as storage, so let's use a proper function scoped variable instead. OK pd
* Explicitly print root user in status OWNER columnkn2019-12-151-3/+1
| | | | | | | | | With "owner root:wheel" (any group) the status output prints ":wheel" only, presumably to emphasize that only group membership matters. Always print whatever is configured to be explicit and less confusing. OK jasper
* vmd: start vms defined in vm.conf in a staggered fashionpd2019-12-121-1/+3
| | | | | | | | | | | | This addresses 'thundering herd' problem when a lot of vms are configured in vm.conf. A lot of vms booting in parallel can overload the host and also mess up tsc calibration in openbsd guests as it uses PIT which doesn't fire reliably if the host is overloaded. We default to starting vms with parallelism of ncpuonline and a delay 30 seconds between batches. This is configurable in vm.conf. ok mlarkin@ (also addressed comments from cheloha@)
* Require at least one interface with -ikn2019-10-271-3/+3
| | | | | | | | | | Either a positive count is given or -i is omitted entirely; vm.conf(5) does not allow interface configuration that results in zero interfaces either. Raise the minimium count value to one and tell more about invalid counts with the usual strtonum(3) idiom. OK reyk
* Use (egress) in nat-to examplekn2019-09-151-3/+3
| | | | | | | | | | | | | | | | Without parentheses, this rule evaluates to the static list of addresses at loadtime; this can be a problem when the machine's network is not fully established when pf.conf is loaded. From pf.conf(5): When the interface name is surrounded by parentheses, the rule is automatically updated whenever the interface changes its address. The ruleset does not need to be reloaded. This is especially useful with NAT. This syncs vmctl(8) with the VMM FAQ. Pointed out by Matthias Schmidt, thanks!
* Remove unused VMD_DISK_INVALID message type and mark it obsolete.tobhe2019-09-071-6/+1
| | | | ok mlarkin@
* vmctl(8): fix wrong output when using 'vmctl stop'mlarkin2019-08-231-2/+5
| | | | | | | | Fix a wrong output when using 'vmctl stop' without any further arguments. Patch from Caspar Schutijser, thanks! ok deraadt
* Improve the error message when supplying an invalid template to vmctlanton2019-08-141-1/+5
| | | | | | | start. Favoring 'invalid template' over 'permission denied' should give the user a better hint on what went wrong. ok kn@ mlarkin@
* Fix a bunch of typos in various man pages.fcambus2019-08-081-3/+3
|
* zap an extra space in usage();jmc2019-07-051-2/+2
| | | | from alessandro gallo
* zap trailing whitespace;jmc2019-05-311-3/+3
|
* Change vmctl(8) syntax: command options before the disk/name/id argument.reyk2019-05-292-49/+33
| | | | | | | | | | | | | | | vmctl had a CLI-style syntax (bgpctl-style) for a short time but I changed it back to a more suitable getopt syntax. I replaced the CLI tokens to getopts flags but didn't consider swapping the order of command options and arguments to be more UNIX-like again ("vmctl create disk.img size 10G" simply became "vmctl create disk.img -s 10G"). This changes "create", "start", and "stop" commands to the commonly expected syntax like "vmctl create -s 10G disk.img". Requested by many OK mlarkin@ kn@ solene@
* re-order to reported states based on order of significance:jasper2019-05-221-7/+7
| | | | | | paused takes priority over running; running takes priority over disabled ok mlarkin@ pd@
* treat vms that are disabled in vm.conf the same as any other vm that's stoppedjasper2019-05-161-4/+2
| | | | | | "disabled" in this context might imply it being broken or otherwise unusable prompted by and ok mlarkin@
* Delete some .Sx macros that were used in a wrong way.schwarze2019-05-141-5/+3
| | | | Part of a patch from Stephen Gregoratto <dev at sgregoratto dot me>.
* report vm state through 'vmctl status'; whereas previously this would display the state ofjasper2019-05-112-12/+40
| | | | | | | the vcpu (which is why it got removed), it now actually reports the correct state (running, stopped, disabled, paused, etc) ok ccardenas@ mlarkin@
* remove receive_vm prototype for the function does not exist (anymore)jasper2019-05-101-2/+1
| | | | ok pd@
* double macro snuck in;jmc2019-05-061-2/+1
|
* vmctl.8 : man page cleanupmlarkin2019-05-061-29/+33
| | | | input from jmc@
* Report reliable VM state on status commandkn2019-04-021-17/+8
| | | | | | | | | | | | | | | `vmctl status id' reports the VM's VCPU states, that is whether they are running or halted. Given that only one VCPU is currently supported per VM and the undocumented states change across repetitive status commands, change it to indicate the VM's general state based on whether the respective host procces is running or not. This makes vmctl reliably report "STATE: RUNNING" and "STATE: STOPPED" for started and stopped VMs respectively. OK mlarkin
* Consistently use imperative present tense throughout the manualkn2019-03-181-4/+4
| | | | Feedback and OK jmc
* An existing VM may be started by referencing its IDkn2019-03-182-6/+10
| | | | | | | | Document `vmctl start id ...' again but be clear about the difference between starting new and existing VMs by name and ID respectively. This completes what I started with vmctl.8 revision 1.61. Feedback and OK jmc
* Clarify that VM names must start with a letterkn2019-03-071-6/+8
| | | | | | | | `start' requires an alphanumeric VM name, must not be a number and in fact must not start with a digit. Improve and simplify the current requirements as starting with a letter directly implies all of the above. OK mlarkin, feedback jmc
* Fix previous extra arguments commitkn2019-03-011-1/+7
| | | | | | | | | I blatantly missed the argc/argv adjustments after getopt(3), resulting in valid commands like `vmctl create a -s 1G' to fail. Noticed by ajacoutot the hard way. OK ajacoutot jca
* Print usage on extra create, start and stop argumentskn2019-03-011-1/+10
| | | | OK mlarkin
* disable vmd/vmctl for i386pd2019-01-181-2/+2
| | | | | | | | | | | | Next commit will delete vmm(4) for i386. Reasons to delete i386 vmm: - Been broken for a while, almost no one complained. - Had been falling out of sync from amd64 while it worked. - If your machine has vmx, you most probably can run amd64, so why not run that? ok mlarkin@ deraadt@
* show log/reset/stop as single commands, like usage() currently does;jmc2018-12-181-16/+14
| | | | ok mlarkin claudio
* sync usage(); also, stop enclosing arg names in quotes, since it wasjmc2018-12-141-13/+13
| | | | | | | applied inconsistently, and applied consistently would make it look like spaghetti; ok mlarkin
* various minor tweaks; ok mlarkinjmc2018-12-131-13/+14
|
* Extend vmctl start -B argument to work for disk, cdrom and net.claudio2018-12-112-9/+28
| | | | | | Currently SeaBIOS will respect disk and cdrom and our kernel will understand net. OK ccardenas@, reyk@, mlarkin@
* zap trailing whitespaceanton2018-12-071-3/+3
|
* Add a new argument -B device to vmctl start. It allows to set the boot device.claudio2018-12-064-10/+28
| | | | | | | At the moment only 'net' is supported and all other values are silently ignored. This allows to kick of an OpenBSD autoinstall by using: vmctl start "installer" -Lc -B net -b bsd.rd -d disk.img OK ccardenas@
* Add 'vmctl wait <VM>' a command that waits until the specified VM isclaudio2018-12-044-7/+65
| | | | | | stopped/terminates. Useful in scripts when waiting until a vm has finished its work. Ok ccardenas@, reyk@
* Move the {qcow2,raw} create functions from vmctl into vmd/vio{qcow2,raw}.creyk2018-11-263-188/+8
| | | | | | This way they are in the appropriate place and code can be shared with vmd. Ok ori@ mlarkin@ ccardenas@
* DNS goes over both udp and tcp, so reflect that in example pf.conf line;otto2018-11-201-3/+3
| | | | ok reyk@
* remove unneccessary macros;jmc2018-10-201-5/+4
|
* Add support to create and convert disk images from existing imagesreyk2018-10-195-66/+358
| | | | | | | | | | | | | | The -i option to vmctl create (eg. vmctl create output.qcow2 -i input.img) lets you create a new image from an input file and convert it if it is a different format. This allows to convert qcow2 images from raw images, raw from qcow2, or even qcow2 from qcow2 and raw from raw to re-optimize the disk. This re-uses Ori's vioqcow2.c from vmd by reaching into it and compiling it in. The API has been adjust to be used from both vmctl and vmd accordingly. OK mlarkin@
* Add support for qcow2 base images (external snapshots).reyk2018-10-084-33/+75
| | | | | | | | | | | | | | | | | | | | | This works is from Ori Bernstein, committing on his behalf: Add support to vmd for external snapshots. That is, snapshots that are derived from a base image. Data lookups start in the derived image, and if the derived image does not contain some data, the search proceeds ot the base image. Multiple derived images may exist off of a single base image. A limitation of this format is that modifying the base image will corrupt the derived image. This change also adds support for creating disk derived disk images to vmctl. To use it: vmctl create derived.qcow2 -s 16G -b base.qcow2 From Ori Bernstein OK mlarkin@ reyk@
* Setting getopt optreset to 1 needs an additional reset of optind to 1.reyk2018-10-051-1/+2
| | | | OK millert@
* Fix potential rounding errors when calculating the qcow2 l1 and ref tables sizesreyk2018-10-021-8/+7
| | | | OK ccardenas@ mlarkin@
* Try to derive the qcow2 file format from an image file automatically.reyk2018-10-013-43/+82
| | | | | | | | | | | | | | This makes the "-d qcow2:" and "format qcow" arguments optional as vmctl and vmd will read the magic bytes at the beginning of a file to guess if it is a raw or a qcow image file. The "vmctl create" command has been changed by removing the -f qcow2 option and replacing it with the same syntax as -d: "vmctl create qcow2:foo.img". In a slightly ununixy but intended way, the create command now also considers the file extension for the format as "vmctl create foo.qcow2" creates a qcow2 disk and not a raw image file. Ok mlarkin@ (and ccardenas@ on an earlier version of the diff)
* Add vmctl stop -a [-fw] option to stop or terminate all running VMs.reyk2018-09-274-33/+105
| | | | | | This is also be used to simplify the vmd rc stop script. OK mlarkin@ ccardenas@
* Add explanations about vmctl send commandsolene2018-09-211-2/+9
| | | | | ok jmc@ jca@ mlarkin@ mdoc tip from bentley@
* Use user_from_uid(3) and group_from_gid(3) in a few more placesmillert2018-09-161-8/+8
| | | | that do repeated lookups. OK tb@
* Add initial set of unveil's to vmctl.ccardenas2018-09-131-4/+12
| | | | | | Was in snaps for a while. Ok mlarkin@ and reyk@