-
Notifications
You must be signed in to change notification settings - Fork 554
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
config: Add VM-based container configuration section
This adds a section to describe VM based container configurations to be used by OCI runtimes using hardware virtualization to provide another layer of isolation. As part of this section we define 3 entries: - A virtual machine root image opbject. This is the guest image that contains the virtual machine root filesystem. The container image will be mounted on top of that filesystem. - A virtual machine kernel object. This is the kernel that will boot inside the virtual machine. The object describes the host kernel image path, additional parameters and an optional guest initrd for the kernel to use. - A virtual machine hypervisor object. This is the hypervisor that will manage the container virtual machine from the host. The object describe a hypervisor binary path and some additional parameters. Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
- Loading branch information
1 parent
b2d941e
commit 9ae489f
Showing
5 changed files
with
165 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# <a name="VirtualMachineSpecificContainerConfiguration" /> Virtual-machine-specific Container Configuration | ||
|
||
This section describes the schema for the [virtual-machine-specific section](config.md#platform-specific-configuration) of the [container configuration](config.md). | ||
The virtual-machine container specification provides additional configuration for the hypervisor, kernel, and image. | ||
|
||
## <a name="HypervisorObject" /> Hypervisor Object | ||
|
||
**`hypervisor`** (object, OPTIONAL) specifies details of the hypervisor that manages the container virtual machine. | ||
* **`path`** (string, REQUIRED) path to the hypervisor binary that manages the container virtual machine. | ||
This value MUST be an absolute path in the [runtime mount namespace](glossary.md#runtime-namespace). | ||
* **`parameters`** (array of strings, OPTIONAL) specifies an array of parameters to pass to the hypervisor. | ||
|
||
### Example | ||
|
||
```json | ||
"hypervisor": { | ||
"path": "/path/to/vmm", | ||
"parameters": ["opts1=foo", "opts2=bar"] | ||
} | ||
``` | ||
|
||
## <a name="KernelObject" /> Kernel Object | ||
|
||
**`kernel`** (object, REQUIRED) specifies details of the kernel to boot the container virtual machine with. | ||
* **`path`** (string, REQUIRED) path to the kernel used to boot the container virtual machine. | ||
This value MUST be an absolute path in the [runtime mount namespace](glossary.md#runtime-namespace). | ||
* **`parameters`** (array of strings, OPTIONAL) specifies an array of parameters to pass to the kernel. | ||
* **`initrd`** (string, OPTIONAL) path to an initial ramdisk to be used by the container virtual machine. | ||
This value MUST be an absolute path in the [runtime mount namespace](glossary.md#runtime-namespace). | ||
|
||
### Example | ||
|
||
```json | ||
"kernel": { | ||
"path": "/path/to/vmlinuz", | ||
"parameters": ["foo=bar", "hello world"], | ||
"initrd": "/path/to/initrd.img" | ||
} | ||
``` | ||
|
||
## <a name="ImageObject" /> Image Object | ||
|
||
**`image`** (object, OPTIONAL) specifies details of the image that contains the root filesystem for the container virtual machine. | ||
* **`path`** (string, REQUIRED) path to the container virtual machine root image. | ||
This image contains the root filesystem that the virtual machine **`kernel`** will boot into, not to be confused with the container root filesystem itself. The latter, as specified by **`path`** from the [Root Configuration](config.md#Root-Configuration) section, will be mounted inside the virtual machine at a location chosen by the virtual-machine-based runtime. | ||
This value MUST be an absolute path in the [runtime mount namespace](glossary.md#runtime-namespace). | ||
|
||
### Example | ||
|
||
```json | ||
"image": { | ||
"path": "/path/to/vm/rootfs.img", | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -191,6 +191,9 @@ | |
} | ||
} | ||
}, | ||
"vm": { | ||
"$ref": "schema-vm.json#/vm" | ||
}, | ||
"linux": { | ||
"$ref": "config-linux.json#/linux" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{ | ||
"vm": { | ||
"description": "configuration for virtual-machine-based containers", | ||
"id": "https://opencontainers.org/schema/bundle/vm", | ||
"type": "object", | ||
"required" : [ | ||
"kernel", | ||
], | ||
"properties": { | ||
"hypervisor": { | ||
"description": "hypervisor config used by VM-based containers", | ||
"id": "https://opencontainers.org/schema/bundle/vm/hypervisor", | ||
"type": "object", | ||
"required": [ | ||
"path" | ||
], | ||
"properties": { | ||
"path": { | ||
"id": "https://opencontainers.org/schema/bundle/vm/hypervisor/path", | ||
"$ref": "defs.json#/definitions/FilePath" | ||
}, | ||
"parameters": { | ||
"id": "https://opencontainers.org/schema/bundle/vm/hypervisor/parameters", | ||
"$ref": "defs.json#/definitions/ArrayOfStrings" | ||
} | ||
} | ||
}, | ||
"kernel": { | ||
"description": "kernel config used by VM-based containers", | ||
"id": "https://opencontainers.org/schema/bundle/vm/kernel", | ||
"type": "object", | ||
"required": [ | ||
"path" | ||
], | ||
"properties": { | ||
"path": { | ||
"id": "https://opencontainers.org/schema/bundle/vm/kernel/path", | ||
"$ref": "defs.json#/definitions/FilePath" | ||
}, | ||
"parameters": { | ||
"id": "https://opencontainers.org/schema/bundle/vm/kernel/parameters", | ||
"$ref": "defs.json#/definitions/ArrayOfStrings" | ||
}, | ||
"initrd": { | ||
"id": "https://opencontainers.org/schema/bundle/vm/kernel/initrd", | ||
"$ref": "defs.json#/definitions/FilePath" | ||
} | ||
} | ||
}, | ||
"image": { | ||
"description": "root image config used by VM-based containers", | ||
"id": "https://opencontainers.org/schema/bundle/vm/image", | ||
"type": "object", | ||
"required": [ | ||
"path" | ||
], | ||
"properties": { | ||
"path": { | ||
"id": "https://opencontainers.org/schema/bundle/vm/image/path", | ||
"$ref": "defs.json#/definitions/FilePath" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters