Skip to content

Commit

Permalink
Merge pull request #109 from lemberg/feature/vagrant-disksize
Browse files Browse the repository at this point in the history
Add vagrant-disksize plugin
  • Loading branch information
T2L committed Oct 24, 2019
2 parents 9cd3f2e + a293ce2 commit b07c798
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## Draft Environment 3.x.x

- [GH-96](https://github.com/lemberg/draft-environment/issues/96) - Added vagrant-disksize plugin, which allows to alter VirtualBox disk size. By default VirtualBox disk size is capped at 10Gb, which is fine for most of the projects, unless project has huge database. Introduced new variable `virtualbox.disk_size` (defaults to `10Gb`)
- [GH-104](https://github.com/lemberg/draft-environment/issues/104) - Bump minimum supported Vagrant version to 2.2.6
- [GH-106](https://github.com/lemberg/draft-environment/issues/106) - Converted tests to support Molecule 2

Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ Manages host and/or guest `hosts` files. Draft is configured to create a `hostna

Automatically installs the host's VirtualBox Guest Additions on the guest system.

#### [vagrant-disksize](https://github.com/sprotheroe/vagrant-disksize)

A Vagrant plugin to resize disks in VirtualBox.

#### Vagrant WinNFSd (WINDOWS only)

Dramatically increases disk IO on Windows by adding NFS support.
Expand Down
7 changes: 7 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ TBD
version: 2.6.*
```

- Add new variable `virtualbox.disk_size` to the `vm-settings.yml` file in order to set VirtualBox disk size:

```
virtualbox:
disk_size: 10Gb
```

- If `solr_cores` variable was overwritten, them convert it to the new format, see [UPGRADE.md 1.x.x -> 2.0.x](https://github.com/T2L/ansible-role-solr/blob/2.0.0/UPGRADE.md#1xx---20x)

## Then run
Expand Down
10 changes: 8 additions & 2 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@

# Before we start: auto-install recommended plugins. Code borrowed here:
# https://github.com/hashicorp/vagrant/issues/8055#issuecomment-403171757
# Install Vagrant Host Manager and vagrant-vbguest.
required_plugins = %w(vagrant-hostmanager vagrant-vbguest)
# Installs:
# - vagrant-hostmanager - https://github.com/devopsgroup-io/vagrant-hostmanager
# - vagrant-vbguest - https://github.com/dotless-de/vagrant-vbguest
# - vagrant-disksize - https://github.com/sprotheroe/vagrant-disksize
required_plugins = %w(vagrant-hostmanager vagrant-vbguest vagrant-disksize)

# Additionally install Vagrant WinNFSd on Windows hosts.
require "rbconfig"
Expand Down Expand Up @@ -137,6 +140,9 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
v.memory = configuration.get("virtualbox.memory")
# Set CPU execution cap (in %).
v.customize ["modifyvm", :id, "--cpuexecutioncap", configuration.get("virtualbox.cpuexecutioncap")]
# Set VirtualBox disk size (defaults to 10Gb)
config.disksize.size = configuration.get("virtualbox.disk_size")

# Use host's resolver mechanisms to handle DNS requests.
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
# Allow creation of symlinks in VirtualBox shared folders (works with both
Expand Down
3 changes: 3 additions & 0 deletions default.vm-settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ virtualbox:
# CPU execution cap (in %). Lower this value if host machine has single core
# CPU.
cpuexecutioncap: 100
# VirtualBox disk size (added by vagrant-disksize plugin).
# See https://github.com/sprotheroe/vagrant-disksize
disk_size: 10Gb

# Ansible local configuration.
ansible:
Expand Down

0 comments on commit b07c798

Please sign in to comment.