vagrant-persistent-storage 0.0.42 → 0.0.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +6 -0
- data/lib/vagrant-persistent-storage/action/create_storage.rb +2 -1
- data/lib/vagrant-persistent-storage/config.rb +9 -0
- data/lib/vagrant-persistent-storage/providers/virtualbox/driver/base.rb +2 -2
- data/lib/vagrant-persistent-storage/version.rb +1 -1
- data/sample-vm/partition-false.vagrantfile +2 -5
- data/sample-vm/partition-true.vagrantfile +2 -5
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a8f0348728b20c7721a0b846f9be4a64d51ad67
|
4
|
+
data.tar.gz: 7d6c38360ac0fa416fd5f269bf3a536306f9024c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42b14395e70fda63fab8a5786dd43d8e93a21926b62b5beaba2b76874f7ce5b6bba71f874238ecb77744f8841c8e08e6d38c6b2e1be64913f48c1c642029e230
|
7
|
+
data.tar.gz: 82ce8ce3fe1007c1e02f01c3c7e5fcf4f4552255f1337933cb36b0d93536cbeebae3d299dfc0c563bf0ef834ba154be80b4880f712c61b639322427afe0c8c74
|
data/README.md
CHANGED
@@ -43,6 +43,11 @@ If you are using LVM and you would prefer to use the disk rather than a partitio
|
|
43
43
|
config.persistent_storage.partition = false
|
44
44
|
```
|
45
45
|
|
46
|
+
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`.
|
47
|
+
```ruby
|
48
|
+
config.persistent_storage.variant = 'Fixed'
|
49
|
+
```
|
50
|
+
|
46
51
|
Every `vagrant up` will attach this file as hard disk to the guest machine.
|
47
52
|
A `vagrant destroy` will detach the storage to avoid deletion of the storage by vagrant.
|
48
53
|
A `vagrant destroy` generally destroys all attached drives. See [VBoxManage unregistervm --delete option][vboxmanage_delete].
|
@@ -106,6 +111,7 @@ If your box is not using LVM you must set `config.persistent_storage.use_lvm = f
|
|
106
111
|
* [Alex Tomkins](https://github.com/tomkins)
|
107
112
|
* [Marcin Wolny](https://github.com/mwolny)
|
108
113
|
* [Adam Huffman](https://github.com/verdurin)
|
114
|
+
* [caio2k](https://github.com/caio2k)
|
109
115
|
|
110
116
|
## TODO
|
111
117
|
|
@@ -38,7 +38,8 @@ module VagrantPlugins
|
|
38
38
|
env[:ui].info I18n.t("vagrant_persistent_storage.action.create_storage")
|
39
39
|
location = env[:machine].config.persistent_storage.location
|
40
40
|
size = env[:machine].config.persistent_storage.size
|
41
|
-
env[:machine].
|
41
|
+
variant = env[:machine].config.persistent_storage.variant
|
42
|
+
env[:machine].provider.driver.create_storage(location, size, variant)
|
42
43
|
@app.call(env)
|
43
44
|
end
|
44
45
|
|
@@ -5,6 +5,7 @@ module VagrantPlugins
|
|
5
5
|
class Config < Vagrant.plugin('2', :config)
|
6
6
|
|
7
7
|
attr_accessor :size
|
8
|
+
attr_accessor :variant
|
8
9
|
attr_accessor :create
|
9
10
|
attr_accessor :mount
|
10
11
|
attr_accessor :manage
|
@@ -32,6 +33,7 @@ module VagrantPlugins
|
|
32
33
|
|
33
34
|
def initialize
|
34
35
|
@size = UNSET_VALUE
|
36
|
+
@variant = UNSET_VALUE
|
35
37
|
@create = true
|
36
38
|
@mount = true
|
37
39
|
@manage = true
|
@@ -52,6 +54,7 @@ module VagrantPlugins
|
|
52
54
|
|
53
55
|
def finalize!
|
54
56
|
@size = 0 if @size == UNSET_VALUE
|
57
|
+
@variant = "Standard" if @variant == UNSET_VALUE
|
55
58
|
@create = true if @create == UNSET_VALUE
|
56
59
|
@mount = true if @mount == UNSET_VALUE
|
57
60
|
@manage = true if @manage == UNSET_VALUE
|
@@ -132,6 +135,12 @@ module VagrantPlugins
|
|
132
135
|
:is_class => volgroupname.class.to_s,
|
133
136
|
})
|
134
137
|
end
|
138
|
+
if !machine.config.persistent_storage.variant.kind_of?(String)
|
139
|
+
errors << I18n.t('vagrant_persistent_storage.config.not_a_string', {
|
140
|
+
:config_key => 'persistent_storage.variant',
|
141
|
+
:is_class => variant.class.to_s,
|
142
|
+
})
|
143
|
+
end
|
135
144
|
|
136
145
|
mount_point_path = Pathname.new("#{machine.config.persistent_storage.location}")
|
137
146
|
if ! (mount_point_path.absolute? || mount_point_path.relative?)
|
@@ -16,8 +16,8 @@ module VagrantPlugins
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
-
def create_storage(location, size)
|
20
|
-
execute("createhd", "--filename", File.expand_path(location), "--size", "#{size}")
|
19
|
+
def create_storage(location, size, variant)
|
20
|
+
execute("createhd", "--filename", File.expand_path(location), "--size", "#{size}", "--variant", "#{variant}")
|
21
21
|
end
|
22
22
|
|
23
23
|
def attach_storage(location)
|
@@ -7,16 +7,13 @@ VAGRANTFILE_API_VERSION = "2"
|
|
7
7
|
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
8
8
|
|
9
9
|
# Every Vagrant virtual environment requires a box to build off of.
|
10
|
-
config.vm.box = "precise32"
|
11
|
-
|
12
|
-
# The url from where the 'config.vm.box' box will be fetched if it
|
13
|
-
# doesn't already exist on the user's system.
|
14
|
-
#config.vm.box_url = "http://files.vagrantup.com/precise32.box"
|
10
|
+
config.vm.box = "ubuntu/precise32"
|
15
11
|
|
16
12
|
# configure a persistent storage for mysql data
|
17
13
|
config.persistent_storage.enabled = true
|
18
14
|
config.persistent_storage.location = "virtualdrive.vdi"
|
19
15
|
config.persistent_storage.size = 5000
|
16
|
+
config.persistent_storage.variant = 'Fixed'
|
20
17
|
config.persistent_storage.mountname = 'mysql'
|
21
18
|
config.persistent_storage.filesystem = 'ext4'
|
22
19
|
config.persistent_storage.mountpoint = '/var/lib/mysql'
|
@@ -7,16 +7,13 @@ VAGRANTFILE_API_VERSION = "2"
|
|
7
7
|
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
8
8
|
|
9
9
|
# Every Vagrant virtual environment requires a box to build off of.
|
10
|
-
config.vm.box = "precise32"
|
11
|
-
|
12
|
-
# The url from where the 'config.vm.box' box will be fetched if it
|
13
|
-
# doesn't already exist on the user's system.
|
14
|
-
config.vm.box_url = "http://files.vagrantup.com/precise32.box"
|
10
|
+
config.vm.box = "ubuntu/precise32"
|
15
11
|
|
16
12
|
# configure a persistent storage for mysql data
|
17
13
|
config.persistent_storage.enabled = true
|
18
14
|
config.persistent_storage.location = "virtualdrive.vdi"
|
19
15
|
config.persistent_storage.size = 5000
|
16
|
+
config.persistent_storage.variant = 'Standard'
|
20
17
|
config.persistent_storage.mountname = 'mysql'
|
21
18
|
config.persistent_storage.filesystem = 'ext4'
|
22
19
|
config.persistent_storage.mountpoint = '/var/lib/mysql'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-persistent-storage
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.43
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastian Kusnier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -91,7 +91,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
91
91
|
version: '0'
|
92
92
|
requirements: []
|
93
93
|
rubyforge_project:
|
94
|
-
rubygems_version: 2.
|
94
|
+
rubygems_version: 2.5.2.3
|
95
95
|
signing_key:
|
96
96
|
specification_version: 4
|
97
97
|
summary: A Vagrant plugin that creates a persistent storage and attaches it to guest
|