summaryrefslogtreecommitdiff
path: root/usr.sbin/hostctl/hostctl.8
blob: 3c54dba699742d1003d9c4487c407312492c871d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
.\" $OpenBSD: hostctl.8,v 1.4 2017/01/18 19:57:56 mikeb Exp $
.\"
.\" Copyright (c) 2016 Reyk Floeter <reyk@openbsd.org>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate: January 18 2017 $
.Dt HOSTCTL 8
.Os
.Sh NAME
.Nm hostctl
.Nd display or modify contents of the host's key-value store
.Sh SYNOPSIS
.Nm
.Op Fl qt
.Op Fl f Ar device
.Op Fl i Ar input
.Op Fl o Ar output
.Ar key
.Op Ar value
.Sh DESCRIPTION
The
.Nm
program provides a generic interface for accessing key-value stores on
the system's host.
It is primarily used for an abstracted way to exchange information
with hypervisors that are supported by the
.Xr pvbus 4
subsystem.
When given the name of a specific
.Ar key ,
.Nm
will display the value or list the key names of the subtree.
If the key is followed by a
.Ar value ,
.Nm
will write the new key-value pair to the key-value store.
.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl f Ar device
Use
.Ar device
instead of the default
.Pa /dev/pvbus0 .
.It Fl i Ar input
Read the new value for the specified
.Ar key
from the
.Ar input
file.
.It Fl o Ar output
Save the returned value in the
.Ar output
file.
.It Fl q
Don't ask for confirmation of any default options.
.It Fl t
Print the type of the underlying driver.
.El
.Sh FILES
.Bl -tag -width "/dev/pvbusX" -compact
.It /dev/pvbus Ns Ar u
.Xr pvbus 4
device unit
.Ar u
file.
.El
.Sh EXAMPLES
The
.Xr vmt 4
driver provides access to the
.Dq guestinfo
information that is available in VMware virtual machines:
.Bd -literal -offset indent
# hostctl guestinfo.hostname
vm-111.example.com
# hostctl guestinfo.ip 192.168.100.111
.Ed
.Pp
The
.Xr xen 4
driver provides access to the XenStore that is available in Xen
virtual machines.
The
.Xr pvbus 4
layer abstracts it as a simple key-value interface:
.Bd -literal -offset indent
# hostctl device/vif/0/mac
fe:e1:ba:d0:27:0f
# hostctl device/vif/0/description "My interface"
.Ed
.Pp
The XenStore is a virtual filesystem that also provides directories.
The directory name can be specified as a key to return the contents,
other keys, of the directory:
.Bd -literal -offset indent
# hostctl device
vfb
vbd
vif
console
.Ed
.Pp
Access to the Hyper-V Key-Value Pair exchange interface is provided by the
.Xr hyperv 4
driver.
The
.Xr pvbus 4
layer abstracts access to several pre-defined key pools:
.Em Auto ,
.Em Guest ,
.Em External
and
.Em Guest/Parameters .
Available keys can be listed and set:
.Bd -literal -offset indent
# hostctl Auto/
FullyQualifiedDomainName
IntegrationServicesVersion
NetworkAddressIPv4
NetworkAddressIPv6
OSBuildNumber
OSName
OSMajorVersion
OSMinorVersion
OSVersion
ProcessorArchitecture
# hostctl Auto/FullyQualifiedDomainName `hostname`
.Ed
.Sh SEE ALSO
.Xr pvbus 4
.Sh HISTORY
The
.Nm
program first appeared in
.Ox 5.9 .
.Sh AUTHORS
The
.Nm
program was written by
.An Reyk Floeter Aq Mt reyk@openbsd.org .