Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: Add Hyper-V isolation fields #818

Merged
merged 1 commit into from
May 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions config-windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,25 @@ You can indicate that a container should be started in an a mode where disk flus
"windows": {
"ignoreflushesduringboot": true
}
```

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

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

### Example

```json
"windows": {
"hyperv": {
"utilityvmpath": "C:\\\\path\\\\to\\utilityvm",
"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 @@ -77,6 +77,20 @@
"ignoreflushesduringboot": {
"id": "https://opencontainers.org/schema/bundle/windows/ignoreflushesduringboot",
"type": "boolean"
},
"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 @@ -438,6 +438,8 @@ type Windows struct {
Servicing bool `json:"servicing,omitempty"`
// IgnoreFlushesDuringBoot indicates if the container is being started in a mode where disk writes are not flushed during its boot process.
IgnoreFlushesDuringBoot bool `json:"ignoreflushesduringboot,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 @@ -484,6 +486,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 {
// SandboxPath is a required host-path to the sandbox to be used by the container.
SandboxPath string `json:"sandboxpath"`
// UtilityVMPath is an optional path to the image used for the Utility VM.
UtilityVMPath string `json:"utilityvmpath,omitempty"`
}

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