All Projects → kusnier → Vagrant Persistent Storage

kusnier / Vagrant Persistent Storage

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

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Vagrant Persistent Storage

ansible-role-test-vms
DEPRECATED - A Vagrant configuration to test Ansible roles against a variety of Linux distributions.
Stars: ✭ 42 (-85.26%)
Mutual labels:  vagrant, virtualbox
packer-ubuntu
No description or website provided.
Stars: ✭ 29 (-89.82%)
Mutual labels:  vagrant, virtualbox
magento2-fast-vm
Optimal vagrant developer box for Magento2. Folders synced by nfs/rsync. This box includes Magento developer utilities.
Stars: ✭ 89 (-68.77%)
Mutual labels:  vagrant, virtualbox
rails-development-environment
Development environment for Ruby on Rails based on Vagrant, VirtualBox and Ubuntu 16.04 LTS (Xenial Xerus).
Stars: ✭ 50 (-82.46%)
Mutual labels:  vagrant, virtualbox
appside
Multitenant environment automation.
Stars: ✭ 36 (-87.37%)
Mutual labels:  vagrant, virtualbox
insaneworks-packer-template
CentOS 7-8 8Stream / AlmaLinux 8 / FreeBSD 12 - 13 x64 + VirtualBox / VMWare for Packer Template + FreeBSD 13 / AlmaLinux 9 + Parallels
Stars: ✭ 38 (-86.67%)
Mutual labels:  vagrant, virtualbox
halcyon-vagrant-kubernetes
Vagrant deployment mechanism for halcyon-kubernetes.
Stars: ✭ 12 (-95.79%)
Mutual labels:  vagrant, virtualbox
PSDiskPart
DiskPart PowerShell Module
Stars: ✭ 30 (-89.47%)
Mutual labels:  disk, storage
packer-ubuntu-18.04
packer example - Ubuntu Server 18.04.5
Stars: ✭ 37 (-87.02%)
Mutual labels:  vagrant, virtualbox
New-Machine
Utilizing Vagrant, Packer, Chocolatey, and Boxstarter to Configure my Dev Machines
Stars: ✭ 26 (-90.88%)
Mutual labels:  vagrant, virtualbox
docker-hands-on-guide
Hands on guide for docker, k8s cluster lightweight virtualization.
Stars: ✭ 25 (-91.23%)
Mutual labels:  vagrant, virtualbox
vzvol
vzvol is a general use ZFS zvol management tool, that handles creation, destruction, listing, and formatting with various FSes, in an easy to use single program
Stars: ✭ 27 (-90.53%)
Mutual labels:  virtualbox, storage
junos-orchestration-with-vagrant
How to orchestrate and provision Junos virtual machines with Vagrant
Stars: ✭ 14 (-95.09%)
Mutual labels:  vagrant, virtualbox
k3s-homeops-ansible
Bootstrap a k3s cluster on top of Ubuntu 20.04
Stars: ✭ 47 (-83.51%)
Mutual labels:  vagrant, virtualbox
TYPOTry
A small Vagrant box to try out the most recent TYPO3 release
Stars: ✭ 21 (-92.63%)
Mutual labels:  vagrant, virtualbox
ansible virtualization
Ansible Collection: Virtualization roles
Stars: ✭ 31 (-89.12%)
Mutual labels:  vagrant, virtualbox
moosefs-csi
Container Storage Interface (CSI) for MooseFS
Stars: ✭ 44 (-84.56%)
Mutual labels:  storage, persistent
Imm2Virtual
This is a GUI (for Windows 64 bit) for a procedure to virtualize your EWF(E01), DD (raw), AFF disk image file without converting it, directly with VirtualBox, forensically proof.
Stars: ✭ 40 (-85.96%)
Mutual labels:  disk, virtualbox
wordpress
The WordPress project layout used by many of Seravo's customers, suitable also for local development with Vagrant and git deployment
Stars: ✭ 95 (-66.67%)
Mutual labels:  vagrant, virtualbox
lethe
Secure drive wipe
Stars: ✭ 47 (-83.51%)
Mutual labels:  disk, storage

Vagrant::Persistent-Storage

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

Requires Virtualbox 5/6

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 'myvolgroup'

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). An 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'

If you are using LVM and you would prefer to use the disk rather than a partition, you can set the following configuration:

config.persistent_storage.partition = false

When you expect a lot of writes in the disk (the case for /home mountpoints) it is recommended to change the disk variant to Fixed (fixed allocation) instead of the default Standard (dyanamic allocation). The tested types are Standard (default) and Fixed.

config.persistent_storage.variant    = 'Fixed'

If you want to pass a list of options to the underlying VboxManage storageattach call, you can use the config.persistent_storage.attachoptions option. For instance, if you want to enable TRIM support:

config.persistent_storage.mountoptions = ['defaults', 'discard']
config.persistent_storage.attachoptions = ['--discard', 'on']

Every vagrant up will attach this file as hard disk to the guest machine. A vagrant destroy will detach the storage to avoid deletion of the storage by vagrant. A vagrant destroy generally destroys all attached drives. See VBoxManage 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.

How Is The Storage Created?

Based on the configuration provided, during a vagrant up a bash script is generated and uploaded to $tmpdir/disk_operations_#{mnt_name}.sh (Linux) or disk_operations_#{mnt_name}.ps1 (Windows). If the box has not been previously provisioned the script is executed on a vagrant up. To force the script to be executed again you can run vagrant provision or if you have halted the box, vagrant up --provision.

The outcome of the script being run is placed in the home drive of the vagrant user in a file called disk_operation_log.txt.

Optional settings

config.persistent_storage.part_type_code = '82'

Troubleshooting

If your box is 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.)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].