forked from firecracker-microvm/firecracker-containerd
-
Notifications
You must be signed in to change notification settings - Fork 2
/
firecracker.proto
206 lines (159 loc) · 5.69 KB
/
firecracker.proto
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
syntax = "proto3";
import "types.proto";
option go_package = "proto";
// CreateVMRequest specifies creation parameters for a new FC instance
message CreateVMRequest {
// VM identifier to assign
string VMID = 1;
// Specifies the machine configuration for the VM
FirecrackerMachineConfiguration MachineCfg = 2;
// Specifies the file path where the kernel image is located
string KernelImagePath = 3;
// Specifies the commandline arguments that should be passed to the kernel
string KernelArgs = 4;
// Specifies drive containing the rootfs of the VM
FirecrackerRootDrive RootDrive = 5;
// Specifies additional drives whose contents will be mounted inside the VM on boot.
repeated FirecrackerDriveMount DriveMounts = 6;
// Specifies the networking configuration for a VM
repeated FirecrackerNetworkInterface NetworkInterfaces = 7;
// The number of dummy drives to reserve in advance before running FC instance.
int32 ContainerCount = 8;
// Whether the VM should exit after all tasks running in it have been deleted.
bool ExitAfterAllTasksDeleted = 9;
JailerConfig JailerConfig = 10;
uint32 TimeoutSeconds = 11;
string LogFifoPath = 12;
string MetricsFifoPath = 13;
FirecrackerBalloonDevice BalloonDevice = 14;
}
message CreateVMResponse {
string VMID = 1;
string SocketPath = 2;
string LogFifoPath = 3;
string MetricsFifoPath = 4;
string CgroupPath = 5;
}
message PauseVMRequest {
string VMID = 1;
}
message ResumeVMRequest {
string VMID = 1;
}
message StopVMRequest {
string VMID = 1;
uint32 TimeoutSeconds = 2;
}
message GetVMInfoRequest {
string VMID = 1;
}
message GetVMInfoResponse {
string VMID = 1;
string SocketPath = 2;
string LogFifoPath = 3;
string MetricsFifoPath = 4;
string CgroupPath = 5;
string VSockPath = 6;
}
message SetVMMetadataRequest {
string VMID = 1;
string Metadata = 2;
}
message UpdateVMMetadataRequest {
string VMID = 1;
string Metadata = 2;
}
message GetVMMetadataRequest {
string VMID = 1;
}
message GetVMMetadataResponse {
string Metadata = 1;
}
// DriveExposePolicy is used to configure the method to expose drive files.
// "COPY" is copying the files to the jail, which is the default behavior.
// "BIND" is bind-mounting the files on the jail, assuming a caller pre-configures the permissions of
// the files appropriately.
enum DriveExposePolicy {
COPY = 0;
BIND = 1;
}
message JailerConfig {
string NetNS = 1;
// List of the physical numbers of the CPUs on which processes in that
// cpuset are allowed to execute. See List Format below for a description
// of the format of cpus.
//
// The CPUs allowed to a cpuset may be changed by writing a new list to its
// cpus file.
// Taken from http://man7.org/linux/man-pages/man7/cpuset.7.html
//
// This is formatted as specified in the cpuset man page under "List Format"
// http://man7.org/linux/man-pages/man7/cpuset.7.html
string CPUs = 2;
// List of memory nodes on which processes in this cpuset are allowed to
// allocate memory. See List Format below for a description of the format
// of mems.
// Taken from http://man7.org/linux/man-pages/man7/cpuset.7.html
//
// This is formatted as specified in the cpuset man page under "List Format"
// http://man7.org/linux/man-pages/man7/cpuset.7.html
string Mems = 3;
uint32 UID = 4;
uint32 GID = 5;
// CgroupPath is used to dictate where the cgroup should be located
// relative to the cgroup directory which is
// /sys/fs/cgroup/cpu/<CgroupPath>/<vmID>
// if no value was provided, then /firecracker-containerd will be used as
// the default value
string CgroupPath = 6;
// DriveExposePolicy is used to configure the method to expose drive files.
DriveExposePolicy DriveExposePolicy = 7;
}
message UpdateBalloonRequest {
string VMID = 1;
int64 AmountMib = 2;
}
message GetBalloonConfigRequest {
string VMID = 1;
}
message GetBalloonConfigResponse {
FirecrackerBalloonDevice BalloonConfig = 1;
}
message GetBalloonStatsRequest {
string VMID = 1;
}
message GetBalloonStatsResponse {
// Actual amount of memory (in MiB) the device is holding.
int64 ActualMib = 1;
// Actual number of pages the device is holding.
int64 ActualPages = 2;
// An estimate of how much memory is available (in bytes) for starting new applications, without pushing the system to swap.
int64 AvailableMemory = 3;
// The amount of memory, in bytes, that can be quickly reclaimed without additional I/O.
// Typically these pages are used for caching files from disk.
int64 DiskCaches = 4;
// The amount of memory not being used for any purpose (in bytes).
int64 FreeMemory = 5;
// The number of successful hugetlb page allocations in the guest.
int64 HugetlbAllocations = 6;
// The number of failed hugetlb page allocations in the guest.
int64 HugetlbFailures = 7;
// The number of major page faults that have occurred.
int64 MajorFaults = 8;
// The number of minor page faults that have occurred.
int64 MinorFaults = 9;
// The amount of memory that has been swapped in (in bytes).
int64 SwapIn = 10;
// The amount of memory that has been swapped out to disk (in bytes).
int64 SwapOut = 11;
// Target amount of memory (in MiB) the device aims to hold.
int64 TargetMib = 12;
// Target number of pages the device aims to hold.
int64 TargetPages = 13;
// The total amount of memory available (in bytes).
int64 TotalMemory = 14;
}
message UpdateBalloonStatsRequest {
string VMID = 1;
int64 StatsPollingIntervals = 2;
}