It's actually far easier and less error-prone to create a standard or manual
switch, then configure whichever NAT service the user wants to use manually.
It's now possible to run commands such as "vm l" or "vm conf <guest>"
Also named console ports allows us to not bother trying to find the next nmdm number
Think adding this to `vm list` adds too much complexity when the zfs commands
do a much better job. Having this in info output as commented is a nice idea though.
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.
Create new "generalise" function specifically to remove any fixed configuration
from a guest. This can then be used in any situation where a guest may be copied.
Tested with clone and both uuid & mac are removed. (Note this just removes settings, based
on the fact that these will be generated on next boot)
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 ...".
New options to 'vm switch create' to allow an ip and/or mtu to
be assigned to standard/vxlan switches. Also standard,vxlan &
custom switches can be set as private so no guest interfaces can
communicate.
We already had 3 types of switch (although you could only test vale manually),
with fairly ugly code to handle the differences. Now that a fourth has been added,
split each type into their own 'module'. This adds test vxlan support which can
create arbitrary virtual L2 networks by tunneling traffic over UDP L3.
I don't want to fully rely on these checks as it could stop us from running
on a system that actually supports bhyve. If the system doesn't support bhyve,
and doesn't have dmesg.boot, then bhyve will just fail to run.