Giter VIP home page Giter VIP logo

vagrant-persistent-storage's Introduction

Vagrant::Persistent-Storage

A Vagrant plugin that creates a persistent storage and attaches it to guest machine.

Installation

gem 'vagrant-persistent-storage'

And then execute:

$ bundle

Or install it yourself as:

$ gem install vagrant-persistent-storage

Usage

After installing you can set the location and size of the persistent storage.

The following options will create a persistent storage with 5000 MB:

config.persistent_storage.location = "~/development/sourcehdd.vdi"
config.persistent_storage.size = 5000

Every vagrant up will attach this file as hard disk to the guest machine. An vagrant destroy will detach the storage to avoid deletion of the storage by vagrant. A vagrant destroy generally destroys all attached drives. See VBoxMange unregistervm --delete option.

How to initialize the disk with puppet

This is a sample puppet setup to create a partition on the guest system:

class sources::persistent {
  exec { "fdisk-sourcehd":
    command => "/sbin/fdisk /dev/sdb << EOF
o
n
p
1


w
EOF",
    unless => "/bin/grep sdb1 /proc/partitions",
  }

  exec { "mkfs-sourcehd":
    command     => "/sbin/mkfs.ext3 -L sources -b 4096 /dev/sdb1",
    unless      => "/sbin/dumpe2fs /dev/sdb1"
  }
  
  exec { 'fstab-sourcehd':
    command => '/bin/echo "/dev/disk/by-label/sources /mnt/sources ext3 defaults 0 2" >> /etc/fstab',
    unless  => '/bin/grep ^/dev/disk/by-label/sources /etc/fstab',
  }
  
  exec { 'mount-sourcehd':
    command     => '/bin/mkdir -p /mnt/sources; /bin/mount /mnt/sources',
    subscribe   => Exec['fstab-sourcehd'],
    refreshonly => true,
  }

  Exec['fdisk-sourcehd'] -> Exec['mkfs-sourcehd'] -> Exec['fstab-sourcehd'] -> Exec['mount-sourcehd']
}

TODO

  • There's Always Something to Do
  • Add more options (controller, port, etc.)

vagrant-persistent-storage's People

Contributors

kusnier avatar

Watchers

Jon Baer avatar James Cloos 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.