kvm

package
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2015 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

kvm package provides supporting functions for kvm flavor such as: VM networking, volume sharing

mount.go provides functions for creating mount units for managing inner(kind=empty) and external(kind=host) volumes. note: used only for kvm flavor (lkvm based)

Idea. For example when we have two volumes: 1) --volume=hostdata,kind=host,source=/host/some_data_to_share 2) --volume=temporary,kind=empty then in stage1/rootfs rkt creates two folders (in rootfs of guest)

  1. /mnt/hostdata - which is mounted through 9p host thanks to lkvm --9p=/host/some_data_to_share,hostdata flag shared to quest
  2. /mnt/temporary - is created as empty directory in guest

both of them are then bind mounted to /opt/stage2/<application/<mountPoint.path> for every application, that has mountPoints specified in ACI json

  • host mounting is realized by podToSystemdHostMountUnits (for whole pod), which creates mount.units (9p) required and ordered before all applications service units
  • bind mounting is realized by appToSystemdMountUnits (for each app), which creates mount.units (bind) required and ordered before particular application

note: systemd mount units require /usr/bin/mount

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppToSystemdMountUnits

func AppToSystemdMountUnits(root string, appName types.ACName, volumes []types.Volume, ra *schema.RuntimeApp, unitsDir string) error

AppToSystemdMountUnits prepare bind mount unit for empty or host kind mounting between stage1 rootfs and chrooted filesystem for application

func GetKVMNetArgs

func GetKVMNetArgs(nds []netDescriber) ([]string, []string, error)

GetKVMNetArgs returns additional arguments that need to be passed to kernel and lkvm tool to configure networks properly. Logic is based on Network configuration extracted from Networking struct and essentially from activeNets that expose netDescriber behavior

func GetNetworkDescriptions added in v0.8.1

func GetNetworkDescriptions(n *networking.Networking) []netDescriber

GetNetworkDescriptions explicitly convert slice of activeNets to slice of netDescribers which is slice required by GetKVMNetArgs

func PodToSystemdHostMountUnits

func PodToSystemdHostMountUnits(root string, volumes []types.Volume, appNames []types.ACName, unitsDir string) error

PodToSystemdHostMountUnits create host shared remote file system mounts (using e.g. 9p) according to https://www.kernel.org/doc/Documentation/filesystems/9p.txt. Additionally it creates required directories in stage1MntDir and then prepares bind mount unit for each app. "root" parameter is stage1 root filesystem path. appNames are used to create before/required dependency between mount unit and app service units.

func VolumesToKvmDiskArgs

func VolumesToKvmDiskArgs(volumes []types.Volume) []string

VolumesToKvmDiskArgs prepares argument list to be passed to lkvm to configure shared volumes (only for "host" kind). Example return is ["--9p,src/folder,9ptag"].

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL