Skip to content

Commit

Permalink
Windows: Add Hyper-V isolation fields
Browse files Browse the repository at this point in the history
Signed-off-by: John Howard <[email protected]>
  • Loading branch information
John Howard committed May 22, 2017
1 parent fae0d09 commit c872dc7
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 1 deletion.
23 changes: 22 additions & 1 deletion config-windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,25 @@ For more information about tooling to generate a gMSA, see [Deployment Overview]


[gMSAOverview]: https://aka.ms/windowscontainers/manage-serviceaccounts
[gMSATooling]: https://aka.ms/windowscontainers/credentialspec-tools
[gMSATooling]: https://aka.ms/windowscontainers/credentialspec-tools


## <a name="configWindowsHyperV" />HyperV

`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.

The following parameters can be specified:

* **`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.

* **`sandboxpath`** *(string, REQUIRED)* - specifies the root of the path to the sandbox to be used for the container.

### Example

```json
"windows": {
"hyperv": {
"sandboxpath": "C:\\\\programdata\\\\docker\\\\windowsfilter"
}
}
```
14 changes: 14 additions & 0 deletions schema/config-windows.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,20 @@
"credentialspec": {
"id": "https://opencontainers.org/schema/bundle/windows/credentialspec",
"type": "object"
},
"hyperv": {
"id": "https://opencontainers.org/schema/bundle/windows/hyperv",
"type": "object",
"properties": {
"utilityvmpath": {
"id": "https://opencontainers.org/schema/bundle/windows/hyperv/utilityvmpath",
"type": "string"
},
"sandboxpath": {
"id": "https://opencontainers.org/schema/bundle/windows/hyperv/sandboxpath",
"type": "string"
}
}
}
}
}
Expand Down
10 changes: 10 additions & 0 deletions specs-go/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,8 @@ type Windows struct {
Resources *WindowsResources `json:"resources,omitempty"`
// CredentialSpec contains a JSON object describing a group Managed Service Account (gMSA) specification.
CredentialSpec interface{} `json:"credentialspec,omitempty"`
// HyperV contains information for running a container with Hyper-V isolation.
HyperV *WindowsHyperV `json:"hyperv,omitempty"`
}

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

// WindowsHyperV contains information for configuring a container to run with Hyper-V isolation.
type WindowsHyperV struct {
// UtilityVMPath is an optional path to the image used for the Utility VM.
UtilityVMPath string `json:"utilityvmpath,omitempty"`
// SandboxPath is a required host-path to the sandbox to be used by the container.
SandboxPath string `json:"sandboxpath"`
}

// LinuxSeccomp represents syscall restrictions
type LinuxSeccomp struct {
DefaultAction LinuxSeccompAction `json:"defaultAction"`
Expand Down

0 comments on commit c872dc7

Please sign in to comment.