Skip to content

Commit f362d22

Browse files
author
John Howard
committed
Windows: Add Hyper-V isolation fields
Signed-off-by: John Howard <[email protected]>
1 parent bc3a283 commit f362d22

File tree

3 files changed

+44
-1
lines changed

3 files changed

+44
-1
lines changed

config-windows.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,30 @@ For more information about tooling to generate a gMSA, see [Deployment Overview]
112112
When a container terminates, the Host Compute Service indicates if a Windows update servicing operation is pending.
113113
You can indicate that a container should be started in a mode to apply pending servicing operations via the OPTIONAL `servicing` field of the Windows configuration.
114114

115-
116115
### Example
117116

118117
```json
119118
"windows": {
120119
"servicing": true
121120
}
121+
```
122+
123+
## <a name="configWindowsHyperV" />HyperV
124+
125+
`hyperv` is an OPTIONAL field of the Windows configuration. If present, the container MUST be run with Hyper-V isolation. If omitted, the container MUST be run as a Windows Server container.
126+
127+
The following parameters can be specified:
128+
129+
* **`utilityvmpath`** *(string, OPTIONAL)* - specifies the path to the image used for the utility VM. If not supplied, the runtime will search the container filesystem layers from the bottom-most layer upwards, until it locates "UtilityVM", and default to that path.
130+
131+
* **`sandboxpath`** *(string, REQUIRED)* - specifies the root of the path to the sandbox to be used for the container.
132+
133+
### Example
134+
135+
```json
136+
"windows": {
137+
"hyperv": {
138+
"sandboxpath": "C:\\\\programdata\\\\docker\\\\windowsfilter"
139+
}
140+
}
122141
```

schema/config-windows.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,20 @@
7373
"servicing": {
7474
"id": "https://opencontainers.org/schema/bundle/windows/servicing",
7575
"type": "boolean"
76+
},
77+
"hyperv": {
78+
"id": "https://opencontainers.org/schema/bundle/windows/hyperv",
79+
"type": "object",
80+
"properties": {
81+
"utilityvmpath": {
82+
"id": "https://opencontainers.org/schema/bundle/windows/hyperv/utilityvmpath",
83+
"type": "string"
84+
},
85+
"sandboxpath": {
86+
"id": "https://opencontainers.org/schema/bundle/windows/hyperv/sandboxpath",
87+
"type": "string"
88+
}
89+
}
7690
}
7791
}
7892
}

specs-go/config.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,8 @@ type Windows struct {
436436
CredentialSpec interface{} `json:"credentialspec,omitempty"`
437437
// Servicing indicates if the container is being started in a mode to apply a Windows Update servicing operation.
438438
Servicing bool `json:"servicing,omitempty"`
439+
// HyperV contains information for running a container with Hyper-V isolation.
440+
HyperV *WindowsHyperV `json:"hyperv,omitempty"`
439441
}
440442

441443
// WindowsResources has container runtime resource constraints for containers running on Windows.
@@ -482,6 +484,14 @@ type WindowsNetworkResources struct {
482484
EgressBandwidth *uint64 `json:"egressBandwidth,omitempty"`
483485
}
484486

487+
// WindowsHyperV contains information for configuring a container to run with Hyper-V isolation.
488+
type WindowsHyperV struct {
489+
// UtilityVMPath is an optional path to the image used for the Utility VM.
490+
UtilityVMPath string `json:"utilityvmpath,omitempty"`
491+
// SandboxPath is a required host-path to the sandbox to be used by the container.
492+
SandboxPath string `json:"sandboxpath"`
493+
}
494+
485495
// LinuxSeccomp represents syscall restrictions
486496
type LinuxSeccomp struct {
487497
DefaultAction LinuxSeccompAction `json:"defaultAction"`

0 commit comments

Comments
 (0)