Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

support get kernel, image, hypervisor from oci spec #782

Closed
Ace-Tang opened this issue Sep 25, 2018 · 2 comments
Closed

support get kernel, image, hypervisor from oci spec #782

Ace-Tang opened this issue Sep 25, 2018 · 2 comments

Comments

@Ace-Tang
Copy link
Contributor

Description of problem

As kernel, image and hypervisor information can be pass from oci spec

// VM contains information for virtual-machine-based containers.
type VM struct {
    // Hypervisor specifies hypervisor-related configuration for virtual-machine-based containers.
    Hypervisor VMHypervisor `json:"hypervisor,omitempty"`
    // Kernel specifies kernel-related configuration for virtual-machine-based containers.
    Kernel VMKernel `json:"kernel"`
    // Image specifies guest image related configuration for virtual-machine-based containers.
    Image VMImage `json:"image,omitempty"`
}

// VMHypervisor contains information about the hypervisor to use for a virtual machine.
type VMHypervisor struct {
    // Path is the host path to the hypervisor used to manage the virtual machine.
    Path string `json:"path"`
    // Parameters specifies parameters to pass to the hypervisor.
    Parameters string `json:"parameters,omitempty"`
}

// VMKernel contains information about the kernel to use for a virtual machine.
type VMKernel struct {
    // Path is the host path to the kernel used to boot the virtual machine.
    Path string `json:"path"`
    // Parameters specifies parameters to pass to the kernel.
    Parameters string `json:"parameters,omitempty"`
    // InitRD is the host path to an initial ramdisk to be used by the kernel.
    InitRD string `json:"initrd,omitempty"`
}

// VMImage contains information about the virtual machine root image.
type VMImage struct {
    // Path is the host path to the root image that the VM kernel would boot into.
    Path string `json:"path"`
    // Format is the root image format type (e.g. "qcow2", "raw", "vhd", etc).
    Format string `json:"format"`
}

How about support to resolve these values from config.json.(still keep kata configuration file way)

/cc @jodh-intel

Expected result

(replace this text with an explanation of what you thought would happen)

Actual result

(replace this text with details of what actually happened)


(replace this text with the output of the kata-collect-data.sh script, after
you have reviewed its content to ensure it does not contain any private
information).

@jodh-intel
Copy link
Contributor

This landed in the OCI spec on opencontainers/runtime-spec#949. We could add such support, but afaik there is no easy way to inject such values into the OCI config file, atleast for Docker.

However, we could add the support and then create a "stand alone" runtime test in the tests repo. This test would:

  • Create a config.json by calling kata-runtime spec.
  • Inject the VM config into config.json [1].
  • Invoke the runtime directly in stand alone mode.

We do need to be careful about the proliferation of "config sources" though - see the related issue #753.


[1] - In fact, we could either add a new option (say kata-runtime spec --kata-add-vm-config) or just change the spec command to default to creating the VM object in the config.json based on the runtime's current config options (read from configuration.toml).

@jodh-intel
Copy link
Contributor

/cc @bergwolf.

@jodh-intel jodh-intel added this to To do in Issue backlog Aug 10, 2020
Issue backlog automation moved this from To do to Done Apr 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Issue backlog
  
Done
Development

No branches or pull requests

2 participants