xref: /openbsd-src/usr.sbin/ldomctl/ldom.conf.5 (revision ee96180de911a25bf20a6f878c381b9ba950e865)
1*ee96180dSkn.\" $OpenBSD: ldom.conf.5,v 1.18 2022/10/06 21:35:52 kn Exp $
25e0a1e34Skn.\"
35e0a1e34Skn.\" Copyright (c) 2012 Mark Kettenis <kettenis@openbsd.org>
45e0a1e34Skn.\"
55e0a1e34Skn.\" Permission to use, copy, modify, and distribute this software for any
65e0a1e34Skn.\" purpose with or without fee is hereby granted, provided that the above
75e0a1e34Skn.\" copyright notice and this permission notice appear in all copies.
85e0a1e34Skn.\"
95e0a1e34Skn.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
105e0a1e34Skn.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
115e0a1e34Skn.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
125e0a1e34Skn.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
135e0a1e34Skn.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
145e0a1e34Skn.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
155e0a1e34Skn.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
165e0a1e34Skn.\"
17*ee96180dSkn.Dd $Mdocdate: October 6 2022 $
185e0a1e34Skn.Dt LDOM.CONF 5 sparc64
195e0a1e34Skn.Os
205e0a1e34Skn.Sh NAME
215e0a1e34Skn.Nm ldom.conf
225e0a1e34Skn.Nd Logical Domain configuration
235e0a1e34Skn.Sh DESCRIPTION
245e0a1e34Skn.Nm
255e0a1e34Sknis the configuration file to configure logical domains.
265e0a1e34Skn.Pp
27af444a85SknDomains are defined in the following format:
285e0a1e34Skn.Bl -tag -width Ds
295e0a1e34Skn.It Ic domain Ar name Brq ...
3068257558SknDeclare a scope for resources assigned to the specified domain.
315e0a1e34SknThe scope must be opened and closed with curly braces and contains
325e0a1e34Sknone or more of the following keywords, each on a separate line.
335e0a1e34SknA scope with
345e0a1e34Skn.Ar name
3534ad8cc0Skn.Dq primary
36af444a85Sknconfigures resources for the primary domain.
3741ce3b17SnaddyIf no configuration for the primary domain exists, it is assigned
385e0a1e34Sknall CPU and memory resources not used by any guest domains.
3959eb6c85Skettenis.It Ic vcpu Ar number Ns Op : Ns Ar stride
4068257558SknDeclare the number of virtual CPUs assigned to a domain.
41a8f23883SknOptionally a stride can be specified to allocate
42a8f23883Skn.Ar stride
43a8f23883SknVCPUs at a time but assign only
44a8f23883Skn.Ar number
45a8f23883SknVCPUs to the domain.
4659eb6c85SkettenisThis can be used to distribute virtual CPUs over the available CPU cores.
47d73a4c4fSkn.It Ic memory Ar bytes
4868257558SknDeclare the amount of memory assigned to a domain, in bytes.
49d73a4c4fSkn.Ar bytes
50d73a4c4fSkncan be specified with a human-readable scale, using the format described in
51d73a4c4fSkn.Xr scan_scaled 3 ,
52d73a4c4fSkne.g. 512M.
53*ee96180dSkn.It Ic iodevice Ar device
541692e2ffSkettenisAssign the specified PCIe device to the guest domain.
55*ee96180dSkn.Ar device
56*ee96180dSknmay be either a device path
57*ee96180dSkn.Pq Pa /@400/@2/@0/@8
58*ee96180dSknor a pseudonym
59*ee96180dSkn.Pq Pa /SYS/MB/PCIE0 .
601692e2ffSkettenisThis keyword can be used multiple times.
615e0a1e34Skn.It Ic variable Ar name Ns = Ns Ar value
6268257558SknSet the specified NVRAM variable for the domain.
635e0a1e34SknSee
645e0a1e34Skn.Xr eeprom 8
655e0a1e34Sknfor a list of OpenPROM variables.
664fd4c43cSknThis keyword can be used multiple times.
67693255e2Skn.It Ic vdisk Ar file Op Ar keyword Ns = Ns Ar value ...
685e0a1e34SknThe specified file is used to back a virtual disk of the guest
695e0a1e34Skndomain.
705e0a1e34Skn.Ar file
7115a1baa2Skncan be a block device node or a disk image file created with the
7215a1baa2Skn.Cm create-vdisk
7315a1baa2Skncommand.
745e0a1e34SknThis keyword can be used multiple times.
756aa34a58SknUnless
766aa34a58Skn.Ar boot-device
776aa34a58Sknis set with the
786aa34a58Skn.Cm variable
796aa34a58Skncommand, the first disk will be the default boot device.
80693255e2SknValid options are:
81693255e2Skn.Bl -tag -width Ds
82693255e2Skn.It Ic devalias Ns = Ns Ar name
83693255e2SknAlias the virtual disk as
84693255e2Skn.Ar name .
85693255e2Skn.El
861f2272f6Skn.It Ic vnet Op Ar keyword Ns = Ns Ar value ...
875e0a1e34SknAssign a
885e0a1e34Skn.Xr vnet 4
895e0a1e34Sknnetwork interface to the guest domain.
905e0a1e34SknThis keyword can be used multiple times.
911f2272f6SknValid options are:
925e0a1e34Skn.Bl -tag -width Ds
93b80ebe94Sschwarze.It Ic mac-addr Ns = Ns Ar address
9468257558SknConfigure the MAC address of the interface.
95b80ebe94Sschwarze.It Ic mtu Ns = Ns Ar number
9668257558SknConfigure the MTU of the interface.
97a3b2112fSkn.It Ic devalias Ns = Ns Ar name
98a3b2112fSknAlias the interface as
99a3b2112fSkn.Ar name .
1005e0a1e34Skn.El
1015e0a1e34Skn.El
1025e0a1e34Skn.Sh EXAMPLES
103b80ebe94SschwarzeDefine a domain with 12 virtual cores, 4GB memory, two file based virtual disks
1045e0a1e34Sknand one virtual network interface:
1055e0a1e34Skn.Bd -literal -offset indent
1065e0a1e34Skndomain "puffy" {
1075e0a1e34Skn	vcpu 12
1085e0a1e34Skn	memory 4G
1095e0a1e34Skn	vdisk "/home/puffy/vdisk0"
1105e0a1e34Skn	vdisk "/home/puffy/vdisk1"
1115e0a1e34Skn	vnet
1125e0a1e34Skn}
1135e0a1e34Skn.Ed
1145e0a1e34Skn.Pp
1155e0a1e34SknDefine another one with slightly less resources:
1165e0a1e34Skn.Bd -literal -offset indent
1175e0a1e34Skndomain "salmah" {
1185e0a1e34Skn	vcpu 8
1195e0a1e34Skn	memory 2G
1205e0a1e34Skn	vdisk "/home/salmah/vdisk0"
1215e0a1e34Skn	vdisk "/home/salmah/vdisk1"
1225e0a1e34Skn	vnet
1235e0a1e34Skn}
1245e0a1e34Skn.Ed
1255e0a1e34Skn.Pp
1265e0a1e34SknOn a machine with 32 cores and 64GB physical memory, this leaves 12 cores and
1275e0a1e34Skn58GB memory to the primary domain.
128a8f23883Skn.Pp
129a8f23883SknUse a
130a8f23883Skn.Ar stride
131a8f23883Sknstep size to distribute VCPUs:
132a8f23883Skn.Bd -literal -offset indent
133a8f23883Skndomain "marlus" {
134a8f23883Skn	vcpu 2:4
135a8f23883Skn	memory 4G
136a8f23883Skn	vdisk "/home/marlus/vdisk0"
137a8f23883Skn}
138a8f23883Skn.Ed
139a8f23883Skn.Pp
140a8f23883SknOn a machine with eight threads per physical core, this allocates two strides
141a8f23883Sknof four VCPUs each for the guest domain but assigns only two VCPUs to it, i.e.\&
142a8f23883Sknmakes it occupy an entire physical core while running on two threads only.
1435e0a1e34Skn.Sh SEE ALSO
1445e0a1e34Skn.Xr eeprom 8 ,
1455e0a1e34Skn.Xr ldomctl 8 ,
1465e0a1e34Skn.Xr ldomd 8
14778b2f85aSkn.Sh BUGS
14878b2f85aSknThe hypervisor requires a machine dependent amount of physical memory that is
14978b2f85aSknreserved automatically.
15078b2f85aSknAlthough the Physical Resource Inventory
15178b2f85aSkn.Pq PRI
15278b2f85aSknseems to account for this by presenting less available memory, using the entire
15378b2f85aSknamount via
15478b2f85aSkn.Ic memory
15578b2f85aSknis not always successful, e.g. the hypervisor would reject the configuration and
15678b2f85aSknfallback to
15778b2f85aSkn.Dq factory-default
15878b2f85aSknupon resetting the machine.
15978b2f85aSkn.Pp
16034ad8cc0SknIf in doubt, assign
16134ad8cc0Skn.Ic memory
16234ad8cc0Sknto the
16334ad8cc0Skn.Dq primary
16434ad8cc0Skn.Ic domain
16534ad8cc0Sknexplicitly,
16634ad8cc0Sknsuch that enough memory remains unused for the hypervisor to reserve.
16734ad8cc0SknOn T4 based machines, 1024 megabytes has proven to suffice.
168