Skip to content

Commit c872dc7

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

File tree

3 files changed

+46
-1
lines changed

3 files changed

+46
-1
lines changed

config-windows.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,25 @@ For more information about tooling to generate a gMSA, see [Deployment Overview]
104104

105105

106106
[gMSAOverview]: https://aka.ms/windowscontainers/manage-serviceaccounts
107-
[gMSATooling]: https://aka.ms/windowscontainers/credentialspec-tools
107+
[gMSATooling]: https://aka.ms/windowscontainers/credentialspec-tools
108+
109+
110+
## <a name="configWindowsHyperV" />HyperV
111+
112+
`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.
113+
114+
The following parameters can be specified:
115+
116+
* **`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.
117+
118+
* **`sandboxpath`** *(string, REQUIRED)* - specifies the root of the path to the sandbox to be used for the container.
119+
120+
### Example
121+
122+
```json
123+
"windows": {
124+
"hyperv": {
125+
"sandboxpath": "C:\\\\programdata\\\\docker\\\\windowsfilter"
126+
}
127+
}
128+
```

schema/config-windows.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,20 @@
6969
"credentialspec": {
7070
"id": "https://opencontainers.org/schema/bundle/windows/credentialspec",
7171
"type": "object"
72+
},
73+
"hyperv": {
74+
"id": "https://opencontainers.org/schema/bundle/windows/hyperv",
75+
"type": "object",
76+
"properties": {
77+
"utilityvmpath": {
78+
"id": "https://opencontainers.org/schema/bundle/windows/hyperv/utilityvmpath",
79+
"type": "string"
80+
},
81+
"sandboxpath": {
82+
"id": "https://opencontainers.org/schema/bundle/windows/hyperv/sandboxpath",
83+
"type": "string"
84+
}
85+
}
7286
}
7387
}
7488
}

specs-go/config.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,8 @@ type Windows struct {
434434
Resources *WindowsResources `json:"resources,omitempty"`
435435
// CredentialSpec contains a JSON object describing a group Managed Service Account (gMSA) specification.
436436
CredentialSpec interface{} `json:"credentialspec,omitempty"`
437+
// HyperV contains information for running a container with Hyper-V isolation.
438+
HyperV *WindowsHyperV `json:"hyperv,omitempty"`
437439
}
438440

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

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

0 commit comments

Comments
 (0)