Commit Graph

150 Commits

Author SHA1 Message Date
Jason Tubnor
27c48353cf Add uefi-custom option
Modified the deprecation check to advise of the uefi-custom option.
2019-04-24 11:17:40 +10:00
Olivier Cochard-Labbé
36e35ff899 Fixing destroying vm in non-ZFS mode
Fixing issue https://github.com/churchers/vm-bhyve/issues/300
2019-04-16 17:26:18 +02:00
Matt Churchyard
d885a79ebd Fix #283 we shouldn't try to create a sparse file if template specifies a custom disk 2019-02-08 14:22:15 +00:00
Mateusz Kwiatkowski
76ae90be71 Make cloud-init optional and add pre-flight checks 2019-01-28 12:20:11 +01:00
Mateusz Kwiatkowski
6df1c74a7d Add support for injecting public key with cloud-init
Ref. https://github.com/churchers/vm-bhyve/issues/289
2019-01-28 11:52:06 +01:00
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
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
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
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
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
b9220eef62 Fix issue with ordered shutdown #244 2018-09-17 14:50:56 +01:00
Matt Churchyard
3deb348668 Various style changes 2018-07-02 13:53:35 +01: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
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
4169a47875 Add support for vm destroy guest@snap. Fixes #126 2018-06-25 12:20:47 +00:00
Matt Churchyard
1dc6135cc9 Fix #147. Exit with message if grub-bhyve requested but not found 2018-06-20 12:30:41 +00:00
Matt Churchyard
b4c24b33e8 Finally address #110
Use the -f option to force commands such as reset/destroy/poweroff.
Unfortunately this same option is used for foreground mode when running a vm,
but -f ties up with the force option for many other commands.
2018-06-20 11:59:09 +00:00
Matt Churchyard
a85ef7c4e9 Make sure owner the owner can read disk image files 2018-02-09 09:52:23 +00:00
Mark Johnston
4c931a7e01 Fix exit status for many vm commands
The pattern "[ $? -ne 0 ] && util::err ..." is problematic since it
leaves an exit status of 1 if the test fails, which is the non-error
case. So various commands (e.g., vm datastore add) return status 1 even
when they succeed if this pattern appears as the last line of a command
implementation.

Fix this by mechanically converting this pattern to
"[ $? -eq 0 ] || util:err ...".
2018-02-06 17:39:30 -05:00
Matt Churchyard
ac2cc9265c Add support for virtio_console devices 2016-11-11 15:50:13 +00:00
Matt Churchyard
11329ec421 Allow vm names up to 32 characters 2016-10-18 16:00:06 +01:00
Matt Churchyard
b77b7f80b6 Use column to reduce width of 'vm list' output 2016-08-30 14:36:25 +01:00
Matt Churchyard
abcd642a77 Fix use of dots in vm name when using tmux
Tmux won't allow a dot in a session name as dot has a specific purpose.
Replace it with a ~, which we don't normally allow, so no risk of accidently
using a name that actually exists.
2016-08-19 09:59:37 +01:00
Matt Churchyard
b1d4a73b33 Add datastore option to vm recv 2016-08-03 18:48:27 +01:00
Matt Churchyard
6cbaa4b01b Few improvements to send/recv & tmux support
*Show tmux in console-ports info output
*Look for an available port for recv operation
The recieve command will output the port it is waiting on.
Send should be run as "vm send guestname remotehost:port"
2016-08-03 10:10:44 +01:00
Matt Churchyard
42289f5ca8 Add "media" datastores and extend iso handling
If you have a directory (or network mount) containing iso files, you
can configure vm-bhyve to look there by adding it as
a media datastore. (vm datastore iso my-media /path/to/iso/dir).
Also we now look in the current dir for iso files, and accept full paths.
2016-08-01 16:02:57 +01:00
Matt Churchyard
48d2836b4f Allow multiple guests in start command 2016-07-28 10:17:23 -04:00
Matt Churchyard
fc60d1ed53 Generate a UUID at runtime if we don't have one
This is now consistent with mac addresses which are also generated
at runtime. If a guest is copied manually, these settings can be removed
and new values will be generated automatically on next run.
2016-07-27 07:38:13 -04:00
Matt Churchyard
b88b41381a Add a way to manage global configuration settings.
So far we only have a "console" setting, but there may be more
in the future. This change provides 'vm get' & 'vm set' commands,
that can view or change these config settings.
2016-07-19 15:05:03 +01:00
Matt Churchyard
4ced0019e7 Add an 'interactive' mode (vm -i start|install guest)
This is supported when using tmux for the guest console.
The guest is started on a tmux session, but the session is not
detached so you are immediately placed inside the guest. Similar to
foreground mode, but you can leave the guest running and return to host
using the tmux detach keys (Ctrl+b d)
2016-07-18 13:56:50 +01:00
Matt Churchyard
d564a15548 Support multiple devices on one ahci controller.
Not documented yet and requires ahci_multi_device="yes" in
guest config, but this is only supported on 12-CURRENT anyway.
This currently allows up to 8 devices per controller, but could
allow up to 32. With 3 available slots in UEFI, and 8 per controller,
this means Win guests can now have up to 24 disks, or 96 if we increase
limit to 32 per controller.
2016-07-11 19:30:07 +01:00
Matt Churchyard
918d6f491d Don't try to use cu to connect to a vnc console port 2016-06-28 10:54:10 +01:00
Matt Churchyard
4b8dd3f756 Small fixes to previous tmux commit 2016-06-28 10:43:04 +01:00
Matt Churchyard
7663b5cdd4 Add basic tmux support + a few small fixes
Some users may prefer tmux to using nmdm/cu
Currently requires manually setting `console="tmux"` in $vm_dir/.config/system.conf
2016-06-28 10:38:14 +01:00
Matt Churchyard
12aa3fd037 Move guest_config_set into config:: 2016-06-15 13:06:54 +01:00
Matt Churchyard
52b9f2eb8b Follow some Google shell scripting advice
I already do pretty much everything they advise anyway
Grouping functions together by using "prefix::" is quite a nice feature though.
Nothing too clever, just makes use of the fact that a colon appears
to be a valid character in a shell function.
2016-06-09 10:47:47 +01:00
Matt Churchyard
6b40f8f224 Show vnc details for guest that is locked locally (fbuf wait) 2016-05-27 14:28:24 +01:00
Matt Churchyard
f7b6e08312 Add fbuf wait support and rename mouse to xhci_mouse 2016-05-27 13:49:49 +01:00