Code Monkey home page Code Monkey logo

ebs-pin's Introduction

ebs-pin

Pin EBS volumes to EC2 hosts.

pip install ebs-pin3

Previous versions for 2.7 are available as

pip install ebs-pin

Features

  • If EBS volume exists in same AZ as EC2 instance
    • Attaches it
  • If volume exists in another AZ, then
    • Creates a volume from snapshot and attaches it
  • Otherwise, it creates a new volume and attaches it

Also has a method to create snapshots you can place in cron, and is able to tag volumes

Usage

Attach a new or existing volume

ebs-pin attach -h # Help!
ebs-pin attach -u some-arbitrary-static-id -d /dev/xvdf -s 10 -t gp2 --tags Team=DevOps Application=UnDevOpsLikeHost

Snapshot the current attached volume

ebs-pin snapshot -h # Help!
ebs-pin snapshot -u some-arbitrary-static-id --tags SnappedTag=ChooseSomething

Thanks to

  • This is almost line for line copy of stapler code in Ruby
  • A shout out goes to Gonz who thought of it originally

Build notes

To build and upload

make upload

TODO

  • Check if already mounted before attempting to run again
  • Delete old snapshot once snapshot succeeds, keep X snapshots

ebs-pin's People

Contributors

aarongorka avatar discobean avatar

Stargazers

 avatar

Watchers

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