Created
May 22, 2014 00:42
-
-
Save s-shin/6bfd8ec4dc72e56dd035 to your computer and use it in GitHub Desktop.
Snippet for Vagrantfile v2.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # http://momijiame.tumblr.com/post/67058805910/vagrant-vm | |
| # http://qiita.com/kakipo/items/57186721eaf6b83630ee | |
| def create_disk(vb, name, size_gb, port) | |
| file_path = "./tmp/#{name}.vdi" | |
| unless File.exist?(file_path) | |
| vb.customize ["createhd", | |
| "--filename", file_path, "--size", size_gb * 1024] | |
| vb.customize ["storageattach", :id, | |
| "--storagectl", "SATA", "--port", port, "--device", 0, | |
| "--type", "hdd", "--medium", file_path] | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment