Slide 15
Slide 15 text
Vagrant:ディスク追加-2
Vagrantfile の記述例
--storagectl について、適宜(今回はIDE)記述する
これにより、box以外にもう一つ仮想ディスクが設定される
Vagrant.configure("2") do |config|
config.vm.box = “centos/7"
config.vm.define "node1" do |machine|
machine.vm.hostname = "node1"
machine.vm.provider :virtualbox do |vb|
file_to_disk = ".vagrant/machines/node1/sdb.vdi"
if not File.exist?(file_to_disk) then
vb.customize ["createhd", "--filename", file_to_disk,
"--size", 100 * 1024]
end
vb.customize ['storageattach', :id, '--storagectl', 'IDE’,
'--port', 1,'--device', 0, '--type', 'hdd’,
'--medium', file_to_disk]
end
end