Repository is archived
No commit activity in last 3 years
No release in over 3 years
A Vagrant plugin that creates a persistent storage and attaches it to guest machine. (cjscp version)
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

>= 0
>= 0
 Project Readme

Vagrant::Persistent-Storage

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

Requires Virtualbox 5

Installation

$ vagrant plugin 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, named mysql, mounted on /var/lib/mysql, in a volume group called 'vagrant'

config.persistent_storage.enabled = true
config.persistent_storage.location = "~/development/sourcehdd.vdi"
config.persistent_storage.size = 5000
config.persistent_storage.mountname = 'mysql'
config.persistent_storage.filesystem = 'ext4'
config.persistent_storage.mountpoint = '/var/lib/mysql'
config.persistent_storage.volgroupname = 'myvolgroup'

With config.persistent_storage.mountoptions you can change the mount options (default: defaults).
A example which sets prjquota option with xfs.

config.persistent_storage.mountname    = 'xfs'
config.persistent_storage.filesystem   = 'xfs'
config.persistent_storage.mountpoint   = '/mnt/xfs'
config.persistent_storage.mountoptions = ['defaults', 'prjquota']

Device defaults to /dev/sdb. For boxes with multiple disks, make sure you increment the drive:

config.persistent_storage.diskdevice = '/dev/sdc'

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.

The disk is initialized and added to it's own volume group as specfied in the config; this defaults to 'vagrant'. An ext4 filesystem is created and the disk mounted appropriately, with entries added to fstab ... subsequent runs will mount this disk with the options specified

Windows Guests

Windows Guests must use the WinRM communicator by setting vm.communicator = 'winrm'. An additional option is provided to allow you to set the drive letter using:

config.persistent_storage.drive_letter = 'Z'

Options that are irrelevent to Windows are ignored, such as mountname, filesystem, mountpoint and volgroupname.

Troubleshooting

If your box are not using LVM you must set config.persistent_storage.use_lvm = false.

Supported Providers

  • Only the VirtualBox provider is supported.

Contributors

TODO

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