Commit Graph

428 Commits

Author SHA1 Message Date
Mateusz Kwiatkowski
9e561ac284 Check qemu-img exit code 2018-12-05 00:31:04 +01:00
Mateusz Kwiatkowski
48a2a518cc Add missing options to getopts in core::create 2018-11-29 14:29:01 +01:00
Matt Churchyard
b32f6826ef Merge branch 'master' into vm-parameters 2018-11-29 11:18:59 +00:00
Matt Churchyard
36ad50e907 Merge pull request #262 from runhyve/feature/virtual-images
Initial support for cloud images
2018-11-29 11:17:43 +00:00
Mateusz Kwiatkowski
c76ae38bd2 Ability to override CPU and memory during VM creation
Fixes #273
2018-11-28 21:36:20 +01:00
Matt Churchyard
ed18290d1d Make sure we provide a success exit code on create/destroy 2018-11-14 11:15:25 +00:00
Mateusz kwiatkowski
e1a0c5aaf0 Improve style 2018-10-17 12:05:15 +02:00
Mateusz kwiatkowski
e8953f273e Check whether qemu-img is available 2018-10-17 11:25:09 +02:00
Mateusz kwiatkowski
c880673426 Add support for .tar.gz cloud images 2018-10-17 11:13:40 +02:00
Mateusz kwiatkowski
9099746cba Extract image decompression to separate function
I also added support for .gz file while on that.
2018-10-17 10:13:49 +02:00
Mateusz kwiatkowski
5df6608b59 Use qemu-img dd to write image to volume
qemu-img dd should detect format of image and automatically convert
it to raw while writing to volume
2018-10-17 08:42:52 +02:00
Mateusz kwiatkowski
db6df5b4a6 Unbreak creating virtual machines without cloud image 2018-10-17 08:07:49 +02:00
Mateusz kwiatkowski
3ffbb52d5c Initial support for cloud images
Ref. https://github.com/churchers/vm-bhyve/issues/256
2018-10-17 07:47:19 +02:00
Matt Churchyard
c2ca98d4af Warn users that we've combined uefi setting into loader 2018-10-16 09:24:10 +01:00
Matt Churchyard
985d49fb3f Support ipv6 for standard switches - #257 2018-10-16 09:20:04 +01:00
Matt Churchyard
5df10f2408 Add a "vm restart guest" command
This causes a guest shutdown but then restarts the guest without requiring a full
reload or destroying/re-creating network devices.
2018-10-09 11:09:09 +01:00
Matt Churchyard
edbcf6eed3 Remove uefi setting entirely and use loader=bhyveload/grub/uefi/uefi-csm
This provides a single, consistent way to configure boot method. the guest listing
now shows uefi and uefi-csm guests without having to fudge the uefi setting into loader column.
2018-10-09 10:34:25 +01:00
Matt Churchyard
0cf424198c Allow guests to have a system priority using renice 2018-10-08 15:43:59 +01:00
Matt Churchyard
f235a8ebbd Change loader="" to support bhyveload/grub/uefi
Makes some sense as we display "uefi" under "Loader" when listing guests and only one can be set.
Old uefi="" setting can still be set to "csm" to choose the csm firmware.
2018-10-08 11:39:49 +01:00
Matt Churchyard
69eae5a9ea Current bhyve checks only work on Intel
Maybe we can find some way to confirm bhyve support on AMD, but for now just let it run and see what happens
2018-10-08 10:37:23 +01:00
Matt Churchyard
0cff09e2d8 may change this to "media" datastores at some point as it can be image files as well 2018-10-04 14:58:02 +01:00
Matt Churchyard
18db6a80b1 Allow custom compression functions (issue #248) 2018-10-01 09:24:51 +01:00
Matt Churchyard
b9220eef62 Fix issue with ordered shutdown #244 2018-09-17 14:50:56 +01:00
Matt Churchyard
1f080b262c Add ability to configure handling of restart/fault (not yet documented) 2018-09-17 14:50:04 +01:00
Matt Churchyard
c4a40bff1f Change Windows to put 8 ahci devices on one controller by default
This allows adding disks without pushing network devices onto higher
slots, causing Windows to see it as a new interface.
2018-08-22 09:03:36 +01:00
Matt Churchyard
d2763d307a Allow _ in vm names
Dash/hyphen and underscore are fairly common and benign characters.
Don't see much reason to support much else and possibly cause problems
in other parts of the code.
2018-08-20 12:18:38 +01:00
Matt Churchyard
1fea449a33 Update comments on check_bhyve_support 2018-08-20 12:11:19 +01:00
Matt Churchyard
6f6fac042b Refactor the host checks slightly 2018-08-20 12:08:06 +01:00
Matt Churchyard
3210da78e5 Remove ugly dmesg parsing and replace with checks for a couple of sysctls.
I cannot get confimation from devs that these sysctls are a viable or stable
way of testing for bhyve support (although cap.* sysctls seem fairly solid)
As such, also add an rc option to bypass the lot. This also allows bypassing the iommu
check just in case someone happens to have a iommu-capable machine that we think isn't.
2018-08-20 09:23:44 +01:00
Matt Churchyard
d4532f6da3 Config option for vga=on/off/io and support for ahci-hd install media
Also force install media to be opened read-only
2018-08-14 11:53:50 +01:00
Matt Churchyard
48ae40b504 Wrong default in util::check_name comments 2018-08-14 09:27:08 +01:00
Matt Churchyard
8bc51d4397 Add ability to configure CPU topology 2018-08-13 10:48:19 +01:00
Matt Churchyard
a44d6be56b Add "wired_memory" option to control the -S argument to bhyveload/bhyve
Note that this removes the ability to use bhyve_options="-S"
2018-08-13 09:32:24 +01:00
Matt Churchyard
5a49ed3880 Wrong commands listed in cms::parse_image 2018-07-30 10:52:11 +01:00
Matt Churchyard
fa75cdadfd Allow configuration of default and passthru slots
Adds passthru0="A/B/C=D:E" syntax, where A/B/C is the host device, and D:E
is the bhyve slot/function. We also add start_slot and install_slot configuration options
to allow users to control the slots used by our bhyve device string.
2018-07-06 15:33:06 +01:00
Matt Churchyard
305c9babc5 Remove switch migration code from 1.3 2018-07-05 11:47:17 +01:00
Matt Churchyard
3a63340683 Use switch name as interface name if its <= 12 characters
ifconfig max len is 16 (including the "vm-" prefix). we can't easily take a substring
without possibly risking duplicates. This allows users to easily put things like
"interface vm-public" when configuring utilties like dnsmasq without worrying about
dynamic interface names.
2018-07-03 09:57:35 +01:00
Matt Churchyard
3deb348668 Various style changes 2018-07-02 13:53:35 +01:00
Matt Churchyard
b9c6008ecd Move all logic from vm into lib/vm-base
This makes it much easier to switch between versions or modify functionality
just by switching the library files. Very useful for development and also means
the version displayed by "vm version" is linked to the lib files being used, which
is far more appropriate than just the version of the vm executable you have in PATH.
2018-06-29 09:36:38 +00:00
Matt Churchyard
a8e3b1c5cc Change all option handling to be "vm subcommand <opts>"
To reduce code we originally parsed some options globally, such as "vm -f start ...".
However this was confusing and inconsistent, especially in relation to other commands
such as zfs(8).
2018-06-29 09:03:27 +00:00
Matt Churchyard
eb96491b08 Small change to group tests together 2018-06-29 08:14:20 +00:00
Matt Churchyard
4929301769 Error in last commit regarding ZFS dataset name in vm::prestart 2018-06-28 12:20:33 +00:00
Matt Churchyard
8c117b33a5 Change prestart to pass ZFS dataset instead of filesystem path
Dataset is only of use if running on ZFS, but in that case it is very
useful if the script wants to create snapshots/etc, and the path can
be retrieved from pwd/cwd if needed.
2018-06-28 09:31:42 +00:00
Matt Churchyard
151a2f375c Add a prestart option to allow user code to run before guest starts 2018-06-28 09:17:45 +00:00
Matt Churchyard
af32248e59 Import new switch handling code 2018-06-28 08:59:01 +00:00
Matt Churchyard
6b4b97584e Tidy some functions up and limit switch names to 12 chars 2018-06-27 08:34:12 +00:00
Matt Churchyard
fed0ba11db Have a go at ordered shutdown request #194
Look at running guests and try to stop any listed in $vm_list in reverse order.
Anything else is told to stop in bulk first
2018-06-26 14:06:55 +00:00
Matt Churchyard
52de25c3e8 Fix #133. Can't repro but multiple confirmations that delay helps reboot error 2018-06-26 11:55:57 +00:00
Matt Churchyard
5af359386e Use groups to make managing interfaces a bit cleaner/easier 2018-06-26 10:31:30 +00:00
Matt Churchyard
152cb92250 Simplify stat commands and fix bridge interface listing 2018-06-26 10:16:21 +00:00