vagrant-persistent-storage
vagrant-persistent-storage copied to clipboard
Two persistent storage mounts fail on startup
When following the example in the readme, everything works as expected. However when I add an additional persistent storage config, my first config fails during VM boot. Removing the second and rebooting succeeds.
I'm running vagrant-persistent-storage 0.0.12 on Windows 7 x64, Vagrant 1.6.3.
'The disk drive for /var/lib/mysql is not ready or not present. Continue to wait, or Press S to skip mounting or M for manual recovery'
Redacted config:
config.persistent_storage.enabled = true
config.persistent_storage.location = '
config.persistent_storage.enabled = true
config.persistent_storage.location = '
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.
That'd be great thanks.
+1 for this
+1
Did it get implemented?
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
.
@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
+1 for this as well
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.