|KVM(7)||Standards, Environments, and Macros||KVM(7)|
kvm — zone brand
for running a virtual machine instance under the KVM hypervisor
A kvm branded zone uses the brands(7) framework to provide an environment for running a virtual machine under the KVM hypervisor.
kvm zones are configured mostly via custom
attributes in the zone configuration.
Supported attributes are:
Specifies a ZFS volume dataset name which will be attached to the guest as the boot disk. Additional disks can be specified using the disk attribute, see below.
If the optional serial number is not provided, one will be automatically generated from the disk index. The ZFS volume must also be mapped into the zone using a device block as shown in the example below.
A suitable ZFS volume can be created using the
zfs create -V’ command, for
zfs create -V 30G rpool/bootdisk2
Specifies the path to one or more CD/DVD image (.iso) files that will be inserted into virtual CD/DVD drive(s) in the guest. To specify multiple image files, create multiple attributes with different values of N, starting with 0. If only a single CD image is required, N can be omitted.
Each image file must also be mapped into the zone using an fs block, as shown in the example below.
This parameter configures where the guest's console device is presented. The default value is pipe,id=console0,path=/dev/zconsole which means that the guest's console can be accessed via:
zlogin -C <zone>
Specifies one or more ZFS volume dataset names which will be attached to the guest as disks. To attach multiple disks, create multiple attributes with different values of N. In that case, the disk will be presented on target N. If only a single disk is required, N can be omitted. The disks specified via the disk attribute are in addition to the system boot disk, which is specified using bootdisk.
If the optional serial number is not provided, one will be automatically generated from the disk index. Each ZFS volume must also be mapped into the zone using a device block as shown in the example below.
Specifies the type of interface to which the disks will be attached. Available options are:
Specifies the type of network interface that will be used for the interfaces presented to the guest. Available options are:
Specify the guest's physical memory size. The size argument may be suffixed with one of K, M, G or T to indicate a multiple of kibibytes, mebibytes, gibibytes or tebibytes. If no suffix is given, the value is assumed to be in mebibytes.
The default value, if this attribute is not specified, is 1G.
Any extra options to be passed directly
kvm hypervisor. To add multiple options,
create multiple attriutes with different values of
N. If only a single extra option is required,
N can be omitted.
Specifies the type of the virtual machine. This needs to be set for some guest operating systems so that things are set up as they expect. For most guests, this can be left unset. Supported values are:
Specify the number of guest virtual CPUs. The default value is 1.
This parameter controls whether a virtual frambuffer is attached to the guest and made available via VNC. Available options are:
An example kvm zone is shown below:
create -t kvm set zonepath=/zones/kvm add net set allowed-address=10.0.0.112/24 set physical=vm0 end add device set match=/dev/zvol/rdsk/rpool/kvm0 end add attr set name=ram set type=string set value=2G end add attr set name=vcpus set type=string set value=8 end add attr set name=bootdisk set type=string set value=rpool/kvm0 end add fs set dir=/rpool/iso/debian-9.4.0-amd64-netinst.iso set special=/rpool/iso/debian-9.4.0-amd64-netinst.iso set type=lofs add options ro add options nodevices end add attr set name=cdrom set type=string set value=/rpool/iso/debian-9.4.0-amd64-netinst.iso end
|June 3, 2023||OmniOS|