Git Product home page Git Product logo

placemat's Introduction

GitHub release CircleCI GoDoc Go Report Card

Placemat

Placemat is a tool to simulate data center networks and servers using rkt Pods, QEMU/KVM virtual machines, and Linux networking stacks. Placemat can simulate virtually any kind of network topologies to help tests and experiments for software usually used in data centers.

Features

  • No daemons

    Placemat is a single binary executable. It just builds networks and virtual machines when it starts, and destroys them when it terminates. This simplicity makes placemat great for a continuous testing tool.

  • Declarative YAML

    Networks, virtual machines, and other kind of resources are defined in YAML files in a declarative fashion. Users need not mind the order of creation and/or destruction of resources.

  • Virtual BMC for IPMI power management

    Power on/off/reset of VMs can be done by IPMI commands. See virtual BMC for details.

  • Automation

    Placemat supports cloud-init and ignition to automate virtual machine initialization. Files on the host machine can be exported to guests as a VVFAT drive. QEMU disk images can be downloaded from remote HTTP servers.

    All of these help implementation of fully-automated tests.

  • UEFI

    Not only traditional BIOS, but placemat VMs can be booted in UEFI mode if OVMF is available.

Usage

This project provides these commands:

  • placemat is the main tool to build networks and virtual machines.
  • pmctl is a utility tool to control VMs and Pods.

placemat command

placemat reads all YAML files specified in command-line arguments, then creates resources defined in YAML. To destroy, just kill the process (by sending a signal or Control-C).

$ placemat [OPTIONS] YAML [YAML ...]

Options:
  -bmc-cert string
        Certificate file for BMC HTTPS servers.
  -bmc-key string
        Key file for BMC HTTPS servers.
  -cache-dir string
        directory for cache data
  -data-dir string
        directory to store data (default "/var/scratch/placemat")
  -debug
        show QEMU's and Pod's stdout and stderr
  -enable-virtfs
        enable VirtFS to share files between guest and host OS.
  -force
        force run with removal of garbage
  -graphic
        run QEMU with graphical console
  -listen-addr string
        listen address (default "127.0.0.1:10808")
  -run-dir string
        run directory (default "/tmp")
  -shared-dir string
        shared directory (default "/mnt/placemat")

If -cache-dir is not specified, the default will be /home/${SUDO_USER}/placemat_data if sudo is used for placemat. If sudo is not used, cache directory will be the same as -data-dir. -force is used for forced run. Remaining garbage, for example virtual networks, mounts, socket files will be removed.

pmctl command

pmctl is a command line tool to control VMs, Pods and Networks.

See pmctl

Getting started

Prerequisites

For Ubuntu or Debian, you can install them as follows:

$ sudo apt-get update
$ sudo apt-get install qemu-system-x86 qemu-utils ovmf picocom socat cloud-utils

As to rkt, obtain a deb (or rpm) package then install it as follows:

$ wget https://github.com/rkt/rkt/releases/download/v1.30.0/rkt_1.30.0-1_amd64.deb
$ sudo dpkg -i rkt_1.30.0-1_amd64.deb

Install placemat

You can choose go get or debian package for installation.

Install placemat and pmctl:

$ go get -u github.com/cybozu-go/placemat/pkg/placemat
$ go get -u github.com/cybozu-go/placemat/pkg/pmctl

or

$ wget https://github.com/cybozu-go/placemat/releases/download/v${VERSION}/placemat_${VERSION}_amd64.deb
$ sudo dpkg -i placemat_${VERSION}_amd64.deb

Run examples

See examples how to write YAML files.

To launch placemat from YAML files, run it with sudo as follows:

$ sudo $GOPATH/bin/placemat cluster.yml

To connect to a serial console of a VM, use pmctl node enter:

$ sudo $GOPATH/bin/pmctl node enter VM

This will launch picocom. To exit, type Ctrl-Q, then Ctrl-X.

Specification

See specifications under docs directory.

License

MIT

placemat's People

Contributors

ymmt2005 avatar zoetrope avatar ueokande avatar morimoto-cybozu avatar dulltz avatar ysksuzuki avatar yokaze avatar mitsutaka avatar llamerada-jp avatar binoue avatar kfyharukz avatar masa213f avatar satoru-takeuchi avatar toshipp avatar hhakuri avatar tapih avatar umezawatakeshi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.