virt-launcher

command
v0.0.1-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2017 License: Apache-2.0 Imports: 12 Imported by: 0

README

= virt-launcher =

To run virt-launcher, a running libvirt outside of the container is required. Further a domain.xml needs to be specified.

In its current state the application reads domain.xml file and tells libvirt to start a VM with this specification. Then virt-launcher is sitting around and waiting for system signals. If it gets one, it destroys the starte VM and exits.

== Running virt-launcher ==

Virt-launcher can bestarted through docker with

docker run \
    --rm \
    --volume=/var/run/libvirt/libvirt-sock:/var/run/libvirt/libvirt-sock:Z \
    --volume=$PWD/domain.xml:/domain.xml \
    --detach=false \
    kubevirt/virt-launcher:latest

where $PWD/domain.xml needs to be replaced with a path to a valid domain description file.

On bare metal run

./virt-launcher --domain-path domain.xml --libvirt-uri qemu:///system

== Development ==

=== Build for local usage ===

Checkout the sources and place them in you $GOPATH. Then install govendor with

go get -u github.com/kardianos/govendor
make

=== Building a Docker image ===

go get -u github.com/kardianos/govendor
make docker

=== Starting a VM with kubelet ===

After all docker images are built we can use manifest/manifest-example.yaml to start and stop a VM called testvm with kubelet.

Assuming you are in the virt-controller repository, type

curl -O https://storage.googleapis.com/kubernetes-release/release/v1.3.4/bin/linux/amd64/kubelet
chmod u+x kubelet
sudo mkdir /var/run/vdsm/manifest
sudo cp domain.xml /var/run/vdsm/manifest/testvm.xml
sudo ./kubelet  --config manifest/manifest-example.yaml --allow-privileged=true --docker-only --sync-frequency=10s

The kubelet will scan the manifest folder every 10 seconds for pod definitons and start them. When deleting the pod definition from the manifest folder the kubelet stops the pod and the VM gets destroyed.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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