Giter Site home page Giter Site logo

stolsma / shack Goto Github PK

View Code? Open in Web Editor NEW

This project forked from plunder-app/shack

0.0 0.0 0.0 327 KB

The Plunder chest is virtual environment for developing and testing deployment tooling

License: Apache License 2.0

Go 85.68% Dockerfile 2.49% Makefile 11.84%

shack's Introduction

Shack

The Plunder Shack is virtual environment for developing and testing deployment tooling

Usage

This section will detail the expected usage of shack.

Set Environment Configuration

You can use shack to build and configure the environment, it will generate a example configuration that should work out of the box in most use-cases:

./shack example > shack.yaml

$ cat shack.yaml 
bridgeAddress: 192.168.1.1/24
bridgeName: plunder
nicMacPrefix: 'c0:ff:ee:'
nicPrefix: plunderVM

This configuration specifies the name of the bridge and it's address that it will use, it also specifies the prefix of mac addresses create for VMs along with the prefix of the tap addresses.

Configure Environment

With the configuration in place we can use shack to set up all of the networking infrastructure we require for our virtual machines to live on. We can validate the environment with:

$ sudo ./shack network check
shack Networking configuration
WARN[0000] Link not found  

As we can see, we've not created our shack environment yet, so we'll create and check again (we will also inspect the networking with ip link):

$ sudo ./shack network create
shack Networking configuration

$ sudo ./shack network check
shack Networking configuration

$ ip addr show plunder
3: plunder: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default 
    inet 192.168.1.1/24 brd 192.168.1.255 scope global plunder

Start a virtual machine

With the network in place we will start our virtual machine(s):

$ sudo ./shack vm start
shack VM configuration
Network Device:	plunderVM-b5987b
VM MAC Address:	c0:ff:ee:b5:98:7b
VM UUID:	b5987b

The UUID is used to identify a particular VM, it also is part of it's assigned MAC address and finally is used to communicate with the virtual machine through a socket /tmp/qmp-<UUID>

We can inspect our virtual machine(s) networking:

$ brctl show
bridge name	bridge id		STP enabled	interfaces
plunder		8000.faeed3bc56d0	no		plunderVM-b5987

$ ip addr show plunderVM-b5987
4: plunderVM-b5987: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master plunder state UP group default qlen 1000
    link/ether fa:ee:d3:bc:56:d0 brd ff:ff:ff:ff:ff:ff

Stop a virtual machine

To stop a virtual machine shack will communicate with the qmp socket /tmp/qmp-<UUID>, we can stop our recently started Virtual machine with the command:

$  sudo ./shack vm stop --id b5987b

Note the stop command will wait for 10 seconds before "terminating" the virtual machine. Additional Note, the /tmp/qmp-<UUID> will be removed, however the <UUID>.qcow2 will need removing manually.

Provisioning tooling

In order to use shack as a demonstrating environment then configure your tooling to use the bridgeName as the interface to broadcast on and use the bridgeAddress as the server address/gateway for new machines.

shack's People

Contributors

thebsdbox 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.