Skip to content

Commit 2e588b3

Browse files
Merge pull request #818 from jhowardmsft/hyper-v
Windows: Add Hyper-V isolation fields
2 parents 4d51b59 + 6b7a7ab commit 2e588b3

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

config-windows.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,4 +129,25 @@ You can indicate that a container should be started in an a mode where disk flus
129129
"windows": {
130130
"ignoreflushesduringboot": true
131131
}
132+
```
133+
134+
## <a name="configWindowsHyperV" />HyperV
135+
136+
`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.
137+
138+
The following parameters can be specified:
139+
140+
* **`utilityvmpath`** *(string, OPTIONAL)* - specifies the path to the image used for the utility VM. This would be specified if using a base image which does not contain a utility VM image. 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.
141+
142+
* **`sandboxpath`** *(string, REQUIRED)* - specifies the root of the path to the sandbox to be used for the container.
143+
144+
### Example
145+
146+
```json
147+
"windows": {
148+
"hyperv": {
149+
"utilityvmpath": "C:\\\\path\\\\to\\utilityvm",
150+
"sandboxpath": "C:\\\\programdata\\\\docker\\\\windowsfilter
151+
}
152+
}
132153
```

schema/config-windows.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,20 @@
7777
"ignoreflushesduringboot": {
7878
"id": "https://opencontainers.org/schema/bundle/windows/ignoreflushesduringboot",
7979
"type": "boolean"
80+
},
81+
"hyperv": {
82+
"id": "https://opencontainers.org/schema/bundle/windows/hyperv",
83+
"type": "object",
84+
"properties": {
85+
"utilityvmpath": {
86+
"id": "https://opencontainers.org/schema/bundle/windows/hyperv/utilityvmpath",
87+
"type": "string"
88+
},
89+
"sandboxpath": {
90+
"id": "https://opencontainers.org/schema/bundle/windows/hyperv/sandboxpath",
91+
"type": "string"
92+
}
93+
}
8094
}
8195
}
8296
}

specs-go/config.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,8 @@ type Windows struct {
438438
Servicing bool `json:"servicing,omitempty"`
439439
// IgnoreFlushesDuringBoot indicates if the container is being started in a mode where disk writes are not flushed during its boot process.
440440
IgnoreFlushesDuringBoot bool `json:"ignoreflushesduringboot,omitempty"`
441+
// HyperV contains information for running a container with Hyper-V isolation.
442+
HyperV *WindowsHyperV `json:"hyperv,omitempty"`
441443
}
442444

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

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

0 commit comments

Comments
 (0)