vagrant-persistent-storage 0.0.48 → 0.0.49
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +14 -4
- data/lib/vagrant-persistent-storage/action/attach_storage.rb +2 -1
- data/lib/vagrant-persistent-storage/config.rb +3 -0
- data/lib/vagrant-persistent-storage/providers/virtualbox/driver/base.rb +7 -8
- data/lib/vagrant-persistent-storage/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6c747645f753d9dcc3692e127df6c78c5b05cfc037853adcb39bf45d3c6d0376
|
4
|
+
data.tar.gz: df800f9b0f6c6a16fd8be1838a3c767e350af8c83f7744570b4177baa413836d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e1324f22d8ba5bbf67c30ae7b526fd7602db17bf2abed14443f82087739d2715802eb86593a9a07b0d267c794d4fa99cd764f4eede20340451a7f9165f525da
|
7
|
+
data.tar.gz: 1679290b6c4993d87df4064f41908032d5bf8da4a0d10a3545293cdd1231398b41e950015ba71d318831fa6838894b715d9d28d9c70339d75b088675fb16e65d
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
A Vagrant plugin that creates a persistent storage and attaches it to guest machine.
|
4
4
|
|
5
|
-
Requires Virtualbox 5
|
5
|
+
Requires Virtualbox 5/6
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
@@ -24,7 +24,7 @@ config.persistent_storage.mountpoint = '/var/lib/mysql'
|
|
24
24
|
config.persistent_storage.volgroupname = 'myvolgroup'
|
25
25
|
```
|
26
26
|
|
27
|
-
With `config.persistent_storage.mountoptions` you can change the mount options (default: defaults).
|
27
|
+
With `config.persistent_storage.mountoptions` you can change the mount options (default: defaults).
|
28
28
|
An example which sets `prjquota` option with xfs.
|
29
29
|
```ruby
|
30
30
|
config.persistent_storage.mountname = 'xfs'
|
@@ -48,17 +48,26 @@ When you expect a lot of writes in the disk (the case for `/home` mountpoints) i
|
|
48
48
|
config.persistent_storage.variant = 'Fixed'
|
49
49
|
```
|
50
50
|
|
51
|
+
If you want to pass a list of options to the underlying `VboxManage
|
52
|
+
storageattach` call, you can use the `config.persistent_storage.attachoptions`
|
53
|
+
option. For instance, if you want to enable TRIM support:
|
54
|
+
|
55
|
+
```ruby
|
56
|
+
config.persistent_storage.mountoptions = ['defaults', 'discard']
|
57
|
+
config.persistent_storage.attachoptions = ['--discard', 'on']
|
58
|
+
```
|
59
|
+
|
51
60
|
Every `vagrant up` will attach this file as hard disk to the guest machine.
|
52
61
|
A `vagrant destroy` will detach the storage to avoid deletion of the storage by vagrant.
|
53
62
|
A `vagrant destroy` generally destroys all attached drives. See [VBoxManage unregistervm --delete option][vboxmanage_delete].
|
54
63
|
|
55
|
-
The disk is initialized and added to it's own volume group as specfied in the config;
|
64
|
+
The disk is initialized and added to it's own volume group as specfied in the config;
|
56
65
|
this defaults to 'vagrant'. An ext4 filesystem is created and the disk mounted appropriately,
|
57
66
|
with entries added to fstab ... subsequent runs will mount this disk with the options specified.
|
58
67
|
|
59
68
|
## Windows Guests
|
60
69
|
|
61
|
-
Windows Guests must use the WinRM communicator by setting `vm.communicator = 'winrm'`. An additional option is provided to
|
70
|
+
Windows Guests must use the WinRM communicator by setting `vm.communicator = 'winrm'`. An additional option is provided to
|
62
71
|
allow you to set the drive letter using:
|
63
72
|
|
64
73
|
```ruby
|
@@ -115,6 +124,7 @@ If your box is not using LVM you must set `config.persistent_storage.use_lvm = f
|
|
115
124
|
* [Francesco](https://github.com/cisco87)
|
116
125
|
* [Dimitris Aragiorgis](https://github.com/dimara)
|
117
126
|
* [Symaxion](https://github.com/Symaxion)
|
127
|
+
* [Alex Pyrgiotis](https://github.com/apyrgio)
|
118
128
|
|
119
129
|
## TODO
|
120
130
|
|
@@ -24,7 +24,8 @@ module VagrantPlugins
|
|
24
24
|
|
25
25
|
env[:ui].info I18n.t("vagrant_persistent_storage.action.attach_storage")
|
26
26
|
location = env[:machine].config.persistent_storage.location
|
27
|
-
env[:machine].
|
27
|
+
attachoptions = env[:machine].config.persistent_storage.attachoptions
|
28
|
+
env[:machine].provider.driver.attach_storage(location, attachoptions)
|
28
29
|
|
29
30
|
@app.call(env)
|
30
31
|
|
@@ -17,6 +17,7 @@ module VagrantPlugins
|
|
17
17
|
attr_accessor :mountname
|
18
18
|
attr_accessor :mountpoint
|
19
19
|
attr_accessor :mountoptions
|
20
|
+
attr_accessor :attachoptions
|
20
21
|
attr_accessor :partition
|
21
22
|
attr_accessor :diskdevice
|
22
23
|
attr_accessor :filesystem
|
@@ -46,6 +47,7 @@ module VagrantPlugins
|
|
46
47
|
@mountname = UNSET_VALUE
|
47
48
|
@mountpoint = UNSET_VALUE
|
48
49
|
@mountoptions = UNSET_VALUE
|
50
|
+
@attachoptions = UNSET_VALUE
|
49
51
|
@diskdevice = UNSET_VALUE
|
50
52
|
@filesystem = UNSET_VALUE
|
51
53
|
@volgroupname = UNSET_VALUE
|
@@ -68,6 +70,7 @@ module VagrantPlugins
|
|
68
70
|
@mountname = "" if @mountname == UNSET_VALUE
|
69
71
|
@mountpoint = "" if @mountpoint == UNSET_VALUE
|
70
72
|
@mountoptions = [] if @mountoptions == UNSET_VALUE
|
73
|
+
@attachoptions = [] if @attachoptions == UNSET_VALUE
|
71
74
|
@diskdevice = "" if @diskdevice == UNSET_VALUE
|
72
75
|
@filesystem = "" if @filesystem == UNSET_VALUE
|
73
76
|
@volgroupname = "" if @volgroupname == UNSET_VALUE
|
@@ -15,7 +15,7 @@ module VagrantPlugins
|
|
15
15
|
execute("storagectl", @uuid, "--name", controller_name, "--" + (self.remove_prefix(@version) ? "" : "sata") + "portcount", "2")
|
16
16
|
end
|
17
17
|
end
|
18
|
-
|
18
|
+
|
19
19
|
def remove_prefix(vbox_version)
|
20
20
|
return vbox_version.start_with?("4.3") || vbox_version.start_with?("5.") || vbox_version.start_with?("6.")
|
21
21
|
end
|
@@ -24,7 +24,7 @@ module VagrantPlugins
|
|
24
24
|
execute("createhd", "--filename", File.expand_path(location), "--size", "#{size}", "--variant", "#{variant}")
|
25
25
|
end
|
26
26
|
|
27
|
-
def attach_storage(location)
|
27
|
+
def attach_storage(location, attachoptions)
|
28
28
|
controller_name = get_controller_name
|
29
29
|
if controller_name.nil?
|
30
30
|
controller_name = "SATA Controller"
|
@@ -32,15 +32,15 @@ module VagrantPlugins
|
|
32
32
|
|
33
33
|
location_realpath = File.expand_path(location)
|
34
34
|
|
35
|
+
base_cmd = ["storageattach", @uuid, "--storagectl", get_controller_name, "--type", "hdd", "--medium", "#{location_realpath}"]
|
35
36
|
if controller_name.start_with?("IDE")
|
36
|
-
|
37
|
+
ctrl_args = ["--port", "1", "--device", "0"]
|
37
38
|
elsif controller_name.start_with?("SCSI")
|
38
|
-
|
39
|
+
ctrl_args = ["--port", "15", "--device", "0"]
|
39
40
|
else
|
40
|
-
|
41
|
+
ctrl_args = ["--port", "4", "--device", "0", "--hotpluggable", "on"]
|
41
42
|
end
|
42
|
-
|
43
|
-
|
43
|
+
execute(*(base_cmd + ctrl_args + attachoptions))
|
44
44
|
end
|
45
45
|
|
46
46
|
def detach_storage(location)
|
@@ -122,4 +122,3 @@ module VagrantPlugins
|
|
122
122
|
end
|
123
123
|
end
|
124
124
|
end
|
125
|
-
|
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.49
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastian Kusnier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|