xref: /openbsd/usr.sbin/ldomctl/ldom.conf.5 (revision 09467b48)
1.\" $OpenBSD: ldom.conf.5,v 1.13 2020/02/21 19:39:28 kn Exp $
2.\"
3.\" Copyright (c) 2012 Mark Kettenis <kettenis@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: February 21 2020 $
18.Dt LDOM.CONF 5 sparc64
19.Os
20.Sh NAME
21.Nm ldom.conf
22.Nd Logical Domain configuration
23.Sh DESCRIPTION
24.Nm
25is the configuration file to configure logical domains.
26.Pp
27Domains are defined in the following format:
28.Bl -tag -width Ds
29.It Ic domain Ar name Brq ...
30Declare a scope for resources assigned to the specified domain.
31The scope must be opened and closed with curly braces and contains
32one or more of the following keywords, each on a separate line.
33A scope with
34.Ar name
35.Cm primary
36configures resources for the primary domain.
37If no configuration for the primary domain exists it is assigned
38all CPU and memory resources not used by any guest domains.
39.It Ic vcpu Ar number Ns Op : Ns Ar stride
40Declare the number of virtual CPUs assigned to a domain.
41Optionally a stride can be specified to allocate additional virtual CPUs
42but not assign them to a domain.
43This can be used to distribute virtual CPUs over the available CPU cores.
44.It Ic memory Ar bytes
45Declare the amount of memory assigned to a domain, in bytes.
46.Ar bytes
47can be specified with a human-readable scale, using the format described in
48.Xr scan_scaled 3 ,
49e.g. 512M.
50.It Ic iodevice Ar path
51Assign the specified PCIe device to the guest domain.
52This keyword can be used multiple times.
53.It Ic variable Ar name Ns = Ns Ar value
54Set the specified NVRAM variable for the domain.
55See
56.Xr eeprom 8
57for a list of OpenPROM variables.
58This keyword can be used multiple times.
59.It Ic vdisk Ar file Op Ar keyword Ns = Ns Ar value ...
60The specified file is used to back a virtual disk of the guest
61domain.
62.Ar file
63can be a block device node or a disk image file created with the
64.Cm create-vdisk
65command.
66This keyword can be used multiple times.
67Valid options are:
68.Bl -tag -width Ds
69.It Ic devalias Ns = Ns Ar name
70Alias the virtual disk as
71.Ar name .
72.El
73.It Ic vnet Op Ar keyword Ns = Ns Ar value ...
74Assign a
75.Xr vnet 4
76network interface to the guest domain.
77This keyword can be used multiple times.
78Valid options are:
79.Bl -tag -width Ds
80.It Ic mac-addr Ns = Ns Ar address
81Configure the MAC address of the interface.
82.It Ic mtu Ns = Ns Ar number
83Configure the MTU of the interface.
84.It Ic devalias Ns = Ns Ar name
85Alias the interface as
86.Ar name .
87.El
88.El
89.Sh EXAMPLES
90Define a domain with 12 virtual cores, 4GB memory, two file based virtual disks
91and one virtual network interface:
92.Bd -literal -offset indent
93domain "puffy" {
94	vcpu 12
95	memory 4G
96	vdisk "/home/puffy/vdisk0"
97	vdisk "/home/puffy/vdisk1"
98	vnet
99}
100.Ed
101.Pp
102Define another one with slightly less resources:
103.Bd -literal -offset indent
104domain "salmah" {
105	vcpu 8
106	memory 2G
107	vdisk "/home/salmah/vdisk0"
108	vdisk "/home/salmah/vdisk1"
109	vnet
110}
111.Ed
112.Pp
113On a machine with 32 cores and 64GB physical memory, this leaves 12 cores and
11458GB memory to the primary domain.
115.Sh SEE ALSO
116.Xr eeprom 8 ,
117.Xr ldomctl 8 ,
118.Xr ldomd 8
119.Sh BUGS
120The hypervisor requires a machine dependent amount of physical memory that is
121reserved automatically.
122Although the Physical Resource Inventory
123.Pq PRI
124seems to account for this by presenting less available memory, using the entire
125amount via
126.Ic memory
127is not always successful, e.g. the hypervisor would reject the configuration and
128fallback to
129.Dq factory-default
130upon resetting the machine.
131.Pp
132If in doubt, leave enough memory unused for the hypervisor to reserve.
133On bigger T4 based machines, 1024 megabytes has proven to suffice.
134