Placing extra disk image next to rest of VirtualBox files?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Placing extra disk image next to rest of VirtualBox files?

Thorbjørn Ravn Andersen
I have a situation where I need a very large root disk on a Ubuntu 14.04 image for some long running integration test scenarios, and we have switched to the official bento/ubuntu-14.04 image as it has a LVM root image which can be expanded.

I add an extra "disk" using

---

config.vm.provider "virtualbox" do |v|
v.memory = 8192
v.cpus = 2 # or more for heavy load
# https://stackoverflow.com/a/27878224/53897
v.customize ["createhd", "--filename", "m4_disk0", "--size", "1048576"] # 1 TB
v.customize ["storageattach", :id, "--storagectl", "SATA Controller", "--port", "1", "--type", "hdd", "--medium", "m4_disk0.vdi"]
end
--

(and do some Linux magic later to expand the root drive)

My problem is that right now the m4_disk0.vdi file is created next to the Vagrantfile and
not along the other files for the virtualbox vm.  This is important as my sources is on a fast but 
small SSD and the virtualbox images have been configured to be on a slower but much larger HDD.

I would like to be able to specify this!

Apparently Vagrant _knows_ where the files are placed as the commands shown with "VAGRANT_LOG=info vagrant up"
show the appropriate absolute paths, but (also apparently) the only parameter made available
to the Vagrantfile programmer is the ":id" identifier which is not much use here.

I have very little experience with Ruby so I might not read the documentation correctly.  Pointers and working snippets would be very helpful.

What is the current "correct approach" to what I want to do?

My host is running UBuntu 17.04 with Vagrant 1.9.1.

Thanks

/Thorbjørn

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/a34a3d64-86c2-4651-8d40-4742579aad77%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Placing extra disk image next to rest of VirtualBox files?

Alvaro Miranda Aguilera
Hello

Way better you create your own box with the size and soft you require.

check packer.io tool create VM, and this repo for example:


Thanks
Alvaro.

On Tue, May 23, 2017 at 3:45 PM, Thorbjørn Ravn Andersen <[hidden email]> wrote:
I have a situation where I need a very large root disk on a Ubuntu 14.04 image for some long running integration test scenarios, and we have switched to the official bento/ubuntu-14.04 image as it has a LVM root image which can be expanded.

I add an extra "disk" using

---

config.vm.provider "virtualbox" do |v|
v.memory = 8192
v.cpus = 2 # or more for heavy load
# https://stackoverflow.com/a/27878224/53897
v.customize ["createhd", "--filename", "m4_disk0", "--size", "1048576"] # 1 TB
v.customize ["storageattach", :id, "--storagectl", "SATA Controller", "--port", "1", "--type", "hdd", "--medium", "m4_disk0.vdi"]
end
--

(and do some Linux magic later to expand the root drive)

My problem is that right now the m4_disk0.vdi file is created next to the Vagrantfile and
not along the other files for the virtualbox vm.  This is important as my sources is on a fast but 
small SSD and the virtualbox images have been configured to be on a slower but much larger HDD.

I would like to be able to specify this!

Apparently Vagrant _knows_ where the files are placed as the commands shown with "VAGRANT_LOG=info vagrant up"
show the appropriate absolute paths, but (also apparently) the only parameter made available
to the Vagrantfile programmer is the ":id" identifier which is not much use here.

I have very little experience with Ruby so I might not read the documentation correctly.  Pointers and working snippets would be very helpful.

What is the current "correct approach" to what I want to do?

My host is running UBuntu 17.04 with Vagrant 1.9.1.

Thanks

/Thorbjørn

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/a34a3d64-86c2-4651-8d40-4742579aad77%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHqq0ex70-__V8bhzURjK%2BzTB%2BiWwY6bYi7xmo0TnjTFOmbbaA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Placing extra disk image next to rest of VirtualBox files?

Thorbjørn Ravn Andersen
Why is this "way better"?

I'd really like to just use the official bento image and as it uses LVM it is very easy to work with.  Only problem is this.



On Wednesday, May 24, 2017 at 12:30:10 PM UTC+2, Alvaro Miranda Aguilera wrote:
Hello

Way better you create your own box with the size and soft you require.

check <a href="http://packer.io" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fpacker.io\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF9z5BjHlcVSOqvLDYevZFfvBY5dQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fpacker.io\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF9z5BjHlcVSOqvLDYevZFfvBY5dQ&#39;;return true;">packer.io tool create VM, and this repo for example:

<a href="https://github.com/cbednarski/packer-ubuntu" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fcbednarski%2Fpacker-ubuntu\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGDWd62_5aR2qKhP60c7UcBZzLymA&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fcbednarski%2Fpacker-ubuntu\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGDWd62_5aR2qKhP60c7UcBZzLymA&#39;;return true;">https://github.com/cbednarski/packer-ubuntu

Thanks
Alvaro.

On Tue, May 23, 2017 at 3:45 PM, Thorbjørn Ravn Andersen <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="ngqD2SPQBgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">thorb...@...> wrote:
I have a situation where I need a very large root disk on a Ubuntu 14.04 image for some long running integration test scenarios, and we have switched to the official bento/ubuntu-14.04 image as it has a LVM root image which can be expanded.

I add an extra "disk" using

---

config.vm.provider "virtualbox" do |v|
v.memory = 8192
v.cpus = 2 # or more for heavy load
# <a href="https://stackoverflow.com/a/27878224/53897" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fstackoverflow.com%2Fa%2F27878224%2F53897\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGRJPMhiZo657mg8VP1mF7Upd0vfw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fstackoverflow.com%2Fa%2F27878224%2F53897\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGRJPMhiZo657mg8VP1mF7Upd0vfw&#39;;return true;">https://stackoverflow.com/a/27878224/53897
v.customize ["createhd", "--filename", "m4_disk0", "--size", "1048576"] # 1 TB
v.customize ["storageattach", :id, "--storagectl", "SATA Controller", "--port", "1", "--type", "hdd", "--medium", "m4_disk0.vdi"]
end
--

(and do some Linux magic later to expand the root drive)

My problem is that right now the m4_disk0.vdi file is created next to the Vagrantfile and
not along the other files for the virtualbox vm.  This is important as my sources is on a fast but 
small SSD and the virtualbox images have been configured to be on a slower but much larger HDD.

I would like to be able to specify this!

Apparently Vagrant _knows_ where the files are placed as the commands shown with "VAGRANT_LOG=info vagrant up"
show the appropriate absolute paths, but (also apparently) the only parameter made available
to the Vagrantfile programmer is the ":id" identifier which is not much use here.

I have very little experience with Ruby so I might not read the documentation correctly.  Pointers and working snippets would be very helpful.

What is the current "correct approach" to what I want to do?

My host is running UBuntu 17.04 with Vagrant 1.9.1.

Thanks

/Thorbjørn

--
This mailing list is governed under the HashiCorp Community Guidelines - <a href="https://www.hashicorp.com/community-guidelines.html" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.hashicorp.com%2Fcommunity-guidelines.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGHa_CaKfZaJiwbkUndUQbVGlQCDw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.hashicorp.com%2Fcommunity-guidelines.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGHa_CaKfZaJiwbkUndUQbVGlQCDw&#39;;return true;">https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: <a href="https://github.com/mitchellh/vagrant/issues" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fmitchellh%2Fvagrant%2Fissues\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHxcA5DuHlQlPInMi_k1Pz4pMNqNw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fmitchellh%2Fvagrant%2Fissues\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHxcA5DuHlQlPInMi_k1Pz4pMNqNw&#39;;return true;">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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="ngqD2SPQBgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">vagrant-up+...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/vagrant-up/a34a3d64-86c2-4651-8d40-4742579aad77%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/vagrant-up/a34a3d64-86c2-4651-8d40-4742579aad77%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/vagrant-up/a34a3d64-86c2-4651-8d40-4742579aad77%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/vagrant-up/a34a3d64-86c2-4651-8d40-4742579aad77%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.



--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/7693bdb0-5134-4b4c-b61a-fce28844b7e6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Placing extra disk image next to rest of VirtualBox files?

Alvaro Miranda Aguilera
Hello

of course this is my personal opinion, but now there is the problem on how to find the directory where the VM is running.

I think the best will be run commands around VBoxManage ie list vms and showvminfo to find out the path of the current vm and disk.

I think is totally doable, but you can just copy the bento template and run packer locally and build on that have the size you need.

you can upload to atlas and have the same experience.


Alvaro

On Wed, May 24, 2017 at 3:44 PM, Thorbjørn Ravn Andersen <[hidden email]> wrote:
Why is this "way better"?

I'd really like to just use the official bento image and as it uses LVM it is very easy to work with.  Only problem is this.



On Wednesday, May 24, 2017 at 12:30:10 PM UTC+2, Alvaro Miranda Aguilera wrote:
Hello

Way better you create your own box with the size and soft you require.

check packer.io tool create VM, and this repo for example:


Thanks
Alvaro.

On Tue, May 23, 2017 at 3:45 PM, Thorbjørn Ravn Andersen <[hidden email]> wrote:
I have a situation where I need a very large root disk on a Ubuntu 14.04 image for some long running integration test scenarios, and we have switched to the official bento/ubuntu-14.04 image as it has a LVM root image which can be expanded.

I add an extra "disk" using

---

config.vm.provider "virtualbox" do |v|
v.memory = 8192
v.cpus = 2 # or more for heavy load
# https://stackoverflow.com/a/27878224/53897
v.customize ["createhd", "--filename", "m4_disk0", "--size", "1048576"] # 1 TB
v.customize ["storageattach", :id, "--storagectl", "SATA Controller", "--port", "1", "--type", "hdd", "--medium", "m4_disk0.vdi"]
end
--

(and do some Linux magic later to expand the root drive)

My problem is that right now the m4_disk0.vdi file is created next to the Vagrantfile and
not along the other files for the virtualbox vm.  This is important as my sources is on a fast but 
small SSD and the virtualbox images have been configured to be on a slower but much larger HDD.

I would like to be able to specify this!

Apparently Vagrant _knows_ where the files are placed as the commands shown with "VAGRANT_LOG=info vagrant up"
show the appropriate absolute paths, but (also apparently) the only parameter made available
to the Vagrantfile programmer is the ":id" identifier which is not much use here.

I have very little experience with Ruby so I might not read the documentation correctly.  Pointers and working snippets would be very helpful.

What is the current "correct approach" to what I want to do?

My host is running UBuntu 17.04 with Vagrant 1.9.1.

Thanks

/Thorbjørn

--
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/a34a3d64-86c2-4651-8d40-4742579aad77%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/7693bdb0-5134-4b4c-b61a-fce28844b7e6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHqq0ex3zqgrntB9P6rSiAFvBmuL2SsZPRikLaaPWE3RdpnF2w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.