How is done in production today?
You can easily add a 2nd disk to the storage server, and then use it
for anything you like.
Sample Vagrant file with 1 extra disk
vm_name="db12102"
size_file_to_dbdisk = 50
Vagrant.configure(2) do |config|
config.vm.box = "alvaro/oracle6-preinstall"
config.vm.hostname = "#{vm_name}.
kikitux.net"
config.vm.network :private_network, ip: "192.168.78.3"
config.vm.provider :virtualbox do |vb|
vb.name = vm_name
vb.customize ["modifyvm", :id, "--memory", 5555]
vb.customize ["modifyvm", :id, "--cpus", 4]
port=2
["1"].each do |disk|
file_to_dbdisk = "Y:/VirtualBox/#{vm_name}/#{vm_name}-disk#{disk}.vdi"
if !File.exist?(file_to_dbdisk)
vb.customize ['createhd', '--filename', file_to_dbdisk,
'--size', (size_file_to_dbdisk * 1024).floor ]
end
vb.customize ['storageattach', :id, '--storagectl', 'SATA
Controller', '--port', port, '--device', 0, '--type', 'hdd',
'--medium', file_to_dbdisk]
port=port+1
end
end
config.vm.provision "shell", path: "scripts/sdb.sh"
end
Sample script that won't delete if there is anything in the disk
#!/bin/bash
blkid /dev/sdb*
if [ $? -ne 0 ]; then
mkfs.ext4 -F /dev/sdb
blkid /dev/sdb 2>&1>/dev/null && echo $(blkid /dev/sdb -o export |
head -n1) /u01/stage ext4 defaults 0 0 >> /etc/fstab
mkdir -p /u01/stage
mount /u01/stage
else
echo "filesystem metadata found on sdb, ignoring"
fi
Alvaro
> --
> This mailing list is governed under the HashiCorp Community Guidelines -
>
https://www.hashicorp.com/community-guidelines.html. Behavior in violation
> of those guidelines may result in your removal from this mailing list.
>
> GitHub Issues:
https://github.com/mitchellh/vagrant/issues
> IRC: #vagrant on Freenode
> ---
> You received this message because you are subscribed to the Google Groups
> "Vagrant" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
vagrant-up+...@googlegroups.com.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/vagrant-up/a3fc17d8-ab23-408c-a159-6bb48a90d264%40googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.