libvirt

package
v2.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2023 License: AGPL-3.0 Imports: 9 Imported by: 0

README

Containerized libvirt

To avoid dependency issues with the libvirt setup of the host, we provide a containerized libvirt instance. If no libvirt connection string is provided in the Constellation config file during create, this container is deployed to provide a libvirt daemon for orchestrating Constellation nodes in QEMU.

The container will listen for libvirt connections on localhost:16599. Connecting to the libvirt daemon running in the container and manage the deployment using virsh run the following:

virsh -c "qemu+tcp://localhost:16599/system"

Docker image

Build the image:

DOCKER_BUILDKIT=1 docker build -t ghcr.io/edgelesssys/constellation/libvirt:latest -f cli/internal/libvirt/Dockerfile .

A container of the image is automatically started by the CLI. You can also run the image manually using the following command:

docker run -it --rm \
    --network host \
    --privileged true \
    ghcr.io/edgelesssys/constellation/libvirt:latest

Documentation

Index

Constants

View Source
const LibvirtTCPConnectURI = "qemu+tcp://localhost:16599/system"

LibvirtTCPConnectURI is the default URI to connect to containerized libvirt. Non standard port to avoid conflict with host libvirt. Changes here should also be reflected in the Dockerfile in "cli/internal/libvirt/Dockerfile".

Variables

This section is empty.

Functions

This section is empty.

Types

type Runner

type Runner struct {
	// contains filtered or unexported fields
}

Runner handles starting and stopping of containerized libvirt instances.

func New

func New() *Runner

New creates a new LibvirtRunner.

func (*Runner) Start

func (r *Runner) Start(ctx context.Context, name, imageName string) error

Start starts a containerized libvirt instance.

func (*Runner) Stop

func (r *Runner) Stop(ctx context.Context) error

Stop stops a containerized libvirt instance.

Jump to

Keyboard shortcuts

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