Comments (9)
You can only mount a single drive. The second assignment overrides the first the former drive.
But i can add your request as feature request. Maybe i can find some free time.
from vagrant-persistent-storage.
For someone who ends up here, I'll share the basic idea of workaround without using this plugin. The following Vagrantfile
will provide 50GB /dev/sdb
and 100GB /dev/sdc
.
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.provider :virtualbox do |p|
#
# Add first disk
#
p.customize [
'createmedium', 'disk',
'--filename', "/tmp/sdb.vdi",
'--format', 'VDI',
'--size', 50 * 1024]
p.customize [
'storageattach', :id,
'--storagectl', 'SATAController',
'--port', 1,
'--device', 0,
'--type', 'hdd',
'--medium', "/tmp/sdb.vdi"]
#
# Increase portcount for second disk
#
p.customize [
'storagectl', :id,
'--name', 'SATAController',
'--portcount', 2]
#
# Add second disk
#
p.customize [
'createmedium', 'disk',
'--filename', "/tmp/sdc.vdi",
'--format', 'VDI',
'--size', 100 * 1024]
p.customize [
'storageattach', :id,
'--storagectl', 'SATAController',
'--port', 2,
'--device', 0,
'--type', 'hdd',
'--medium', "/tmp/sdc.vdi"]
end
end
NOTE: 1) Increasing
--portcount
to the number of disks is important. 2) The variable for--storagectl
depends on the box you use, which is usuallySATAController
,SATA Controller
orSATA
.
from vagrant-persistent-storage.
@kjtanaka Thanks! This comment saved me after an hour of frustration. Turns out using createmedium
instead of createhd
was the change I needed to make.
I modified your Vagrantfile slightly so that the VM can be restarted via vagrant reload
:
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.provider :virtualbox do |p|
#
# Add first disk
#
unless File.exists?("/tmp/sdb.vdi")
p.customize [
'createmedium', 'disk',
'--filename', "/tmp/sdb.vdi",
'--format', 'VDI',
'--size', 50 * 1024
]
end
p.customize [
'storageattach', :id,
'--storagectl', 'SATAController',
'--port', 1,
'--device', 0,
'--type', 'hdd',
'--medium', "/tmp/sdb.vdi"
]
#
# Increase portcount for second disk
#
p.customize [
'storagectl', :id,
'--name', 'SATAController',
'--portcount', 2
]
#
# Add second disk
#
unless File.exists?("/tmp/sdc.vdi")
p.customize [
'createmedium', 'disk',
'--filename', "/tmp/sdc.vdi",
'--format', 'VDI',
'--size', 100 * 1024
]
end
p.customize [
'storageattach', :id,
'--storagectl', 'SATAController',
'--port', 2,
'--device', 0,
'--type', 'hdd',
'--medium', "/tmp/sdc.vdi"
]
end
end
from vagrant-persistent-storage.
That'd be great thanks.
from vagrant-persistent-storage.
+1 for this
from vagrant-persistent-storage.
+1
from vagrant-persistent-storage.
Did it get implemented?
from vagrant-persistent-storage.
+1 for this as well
from vagrant-persistent-storage.
Too bad I can't write ruby, I would have started with modifying the config.rb
to be able to extract a set of configuration specifications instead of a single instance.
from vagrant-persistent-storage.
Related Issues (20)
- vagrant destroy leaves stale vbox media behind HOT 4
- can not setup persistent storage HOT 2
- Force delete vdi files on vagrant destroy
- Storage Mount Doesn't Work HOT 1
- VirtualBox Storage does not get removed from Virtual Media Manager
- conflicting dependencies childprocess (= 0.5.9) and childprocess (= 0.6.3) HOT 1
- Typo: volgroupname => part_type_code HOT 1
- use_lvm=true should default mount & format false HOT 1
- Encryption Support
- warning: constant ::Fixnum is deprecated HOT 2
- INFO: rcu_sched detected stalls on CPUs/tasks: HOT 2
- vagrant halt fails with hotplug error HOT 9
- Injected script not created properly, and disk not mounted HOT 1
- Disk space doesn't expand past 6-ish MB HOT 4
- Allow multiple persistent storages HOT 1
- Compatibility with VirtualBox 6.0 HOT 4
- /tmp/ cannot execute. HOT 5
- Timed out waiting for devices dev-persistent-persistent.device HOT 1
- Support disks larger than 2TB
- If location is relative consider it under machine's root directory HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vagrant-persistent-storage.