Git Product home page Git Product logo

Comments (25)

thasmo avatar thasmo commented on May 20, 2024

Sounds like a pretty cool plugin! Any plans on making it compatible to Vagrant 1.2?

from vagrant-persistent-storage.

kusnier avatar kusnier commented on May 20, 2024

I'll see what I can do.

from vagrant-persistent-storage.

zh4ngx avatar zh4ngx commented on May 20, 2024

I think this involves making it compatible with embedded ruby project, rights?

from vagrant-persistent-storage.

madAndroid avatar madAndroid commented on May 20, 2024

I have a (mostly) working modification of this working under vagrant 1.2.3 - in my fork .. it could do with some testing before I submit a pull request. Would anyone like to help with some testing?

from vagrant-persistent-storage.

thasmo avatar thasmo commented on May 20, 2024

Hi there - does it also work using the latest Vagrant version? I'd like to test it, but I'm always on the latest Vagrant version.

from vagrant-persistent-storage.

madAndroid avatar madAndroid commented on May 20, 2024

Not sure, to be honest ... I could upgrade and test it on the latest, but I'm a little reluctant to, since I've got a few other plugins installed that are quite critical to my work, and I don't want to suddenly be unable to use those..

I guess you could try and see? I've been testing by symlinking my checkout to ~/.vagrant.d/gems/gems/vagrant-persistent-storage-0.0.2

It works on 1.2.3, so I'm assuming it will work on 1.2.7 (latest now, apparently)

from vagrant-persistent-storage.

madAndroid avatar madAndroid commented on May 20, 2024

Caveats: it's currently dependent on the VirtualoBox provider, and has hooks that are particular to VBox... this should be fairly straightforward to get working for VMWare fusion, but I've not got that installed to test it.. and it means that the hooks will need to be made provider agnostic/independent.

from vagrant-persistent-storage.

thasmo avatar thasmo commented on May 20, 2024

I'm on Windows but if you tell me how to install the gem I can test the plugin on the currect Vagrant version.

from vagrant-persistent-storage.

madAndroid avatar madAndroid commented on May 20, 2024

you should be able to install it using the vagrant commandline switch:

vagrant plugin install vagrant-persistent-storage

this will install the version that's incompatible with the latest vagrant, but you can then remove the plugin and replace it from one cloned from my fork.

I've not used vagrant or even ruby/gem on Windows before, so I'm a little in the dark about where the plugins are installed etc ... but in order to test the changes I've put in, you'll need to clone from [email protected]:madAndroid/vagrant-persistent-storage.git and then overwrite the original plugin install with the contents of that checkout/clone ... good luck! let me know how you get on.. really interested to see how this works on vagrant on Windows

from vagrant-persistent-storage.

thasmo avatar thasmo commented on May 20, 2024

Okay, I'll have a look soon - just playing around with some packer building. :)

from vagrant-persistent-storage.

madAndroid avatar madAndroid commented on May 20, 2024

hi @kusnier, would you be willing to accept a pull request to implement the vagrant > 1.1.x plugin compatibility?

from vagrant-persistent-storage.

kusnier avatar kusnier commented on May 20, 2024

Yes. I will check first if the changes are working.

from vagrant-persistent-storage.

madAndroid avatar madAndroid commented on May 20, 2024

great stuff :) cheers!

from vagrant-persistent-storage.

kusnier avatar kusnier commented on May 20, 2024

I have tested your changes but something is not working right. The drive is not created and attached.

How i tested:

Created a checkout of your fork.

echo "require 'rubygems'
require 'bundler/setup'
Bundler::GemHelper.install_tasks
" > Rakefile

Fix Version in gemspec:
gem.version = VagrantPlugins::PersistentStorage::VERSION

Remove old vagrant dependency
gem.add_dependency 'vagrant'

Create and install the gem:

bundle install
rake build
vagrant plugin install pkg/vagrant-persistent-storage-0.0.3.gem

Now create a new vagrant box:

Add following to the Vagrantfile

config.persistent_storage.location = "/Users/kuse/testvps/vmtest/testhdd.vdi"
config.persistent_storage.size = 5000
config.persistent_storage.mountname = 'mysql'
config.persistent_storage.filesystem = 'ext4'
config.persistent_storage.mountpoint = '/var/lib/mysql'
config.persistent_storage.volgroupname = 'myvolgroup'

vagrant up
vagrant destroy

The log files can be found on gist: https://gist.github.com/kusnier/6434718

I have used a Mac (10.8.4) for my tests.

from vagrant-persistent-storage.

madAndroid avatar madAndroid commented on May 20, 2024

ah, will need to update the README.md .. I had recently added an 'enabled' switch, here: https://github.com/madAndroid/vagrant-persistent-storage/blob/master/lib/vagrant-persistent-storage/config.rb#L35

can you add that to your config and try again?

config.persistent_storage.enabled = 'true'

perhaps that could be omitted and made implicit on the presence of the other config keys

from vagrant-persistent-storage.

madAndroid avatar madAndroid commented on May 20, 2024

also, just tried with your config .. you'll need to ensure the storage size is quoted: "5000"

from vagrant-persistent-storage.

madAndroid avatar madAndroid commented on May 20, 2024

looks like it's going to need more work ..
most recent testing shows that volume is overwritten whether create is set to true or false ..
I'm not sure why that's happening now, pretty sure it was working before :)

I'll make some more changes when I get the chance, and ensure it's working properly..
it's my first go at ruby, bound to be a few bumps along the way :D

from vagrant-persistent-storage.

kusnier avatar kusnier commented on May 20, 2024

With config.persistent_storage.enabled = 'true' the drive is now created. But this is done with every vagrant up.

I found a other problem. When you do a vagrant destroy a error is thrown.

$ vagrant status
Current machine states:

default                   running (virtualbox)

$ vagrant destroy
[default] ** Detaching persistent storage **
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["storageattach", "36f214d0-d192-44e3-a212-b964a781b567", "--storagectl", "SATA Controller", "--port", "1", "--device", "0", "--type", "hdd", "--medium", "none"]

Stderr: VBoxManage: error: Could not unmount the currently mounted media/drive (VERR_INTERNAL_ERROR)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component Console, interface IConsole, callee nsISupports
VBoxManage: error: Context: "DetachDevice(Bstr(pszCtl).raw(), port, device)" at line 381 of file VBoxManageStorageController.cpp

from vagrant-persistent-storage.

madAndroid avatar madAndroid commented on May 20, 2024

Okay, I've made some changes to address the disk being overwritten, it wasn't being created each time, but the scripts which format the disk were overwriting it, as far as I can tell. This was working okay on centos, but not on ubuntu - I've confirmed that it's working on ubuntu now.

The issue with destroy: I wasn't experiencing that, I'm using Ubuntu; not sure if the hot swap capabilities of virtualbox are different between OSx and Linux. I'm assuming that;s the reason you were seeing that, but my testing didn't bring that up... I've adjusted the hooks here:
https://github.com/madAndroid/vagrant-persistent-storage/blob/e88325eb1f6e5c722cdc01607e176332e954a772/lib/vagrant-persistent-storage/plugin.rb#L42-L47,
which should hopefully resolve that

could you please update from my fork again, and retest? thanks :)

from vagrant-persistent-storage.

kusnier avatar kusnier commented on May 20, 2024

The drive is not accessible after a vagrant halt and vagrant up.

This are my steps for the test:

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
[default] Importing base box 'precise32'...
[default] Matching MAC address for NAT networking...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
[default] Creating shared folders metadata...
[default] Clearing any previously set network interfaces...
[default] Preparing network interfaces based on configuration...
[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] ** Creating adapter for persistent storage **
[default] Booting VM...
[default] Waiting for VM to boot. This can take a few minutes.
[default] VM booted and ready for use!
[default] ** Persistent Storage Volume exists, not creating **
[default] ** Attaching persistent storage **
[default] ** Managing persistent storage **
[default] Mounting shared folders...
[default] -- /vagrant
$ vagrant ssh -c 'sudo fdisk -l /dev/sdb'

Disk /dev/sdb: 5242 MB, 5242880000 bytes
255 heads, 63 sectors/track, 637 cylinders, total 10240000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1    10233404     5116702   8e  Linux LVM
$ vagrant ssh -c 'sudo touch /var/lib/mysql/testfile'
$ vagrant halt
[default] Attempting graceful shutdown of VM...
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
[default] Creating shared folders metadata...
[default] Clearing any previously set network interfaces...
[default] Preparing network interfaces based on configuration...
[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] ** Creating adapter for persistent storage **
[default] Booting VM...
[default] Waiting for VM to boot. This can take a few minutes.
[default] VM booted and ready for use!
[default] ** Persistent Storage Volume exists, not creating **
[default] ** Attaching persistent storage **
[default] ** Managing persistent storage **
[default] Mounting shared folders...
[default] -- /vagrant
$ vagrant ssh -c 'sudo fdisk -l /dev/sdb'
$ vagrant ssh -c 'ls -l /var/lib/mysql/'
ls: reading directory /var/lib/mysql/: Input/output error
total 0

from vagrant-persistent-storage.

madAndroid avatar madAndroid commented on May 20, 2024

Hi, I've made a number of changes to address the issues you've discovered during your testing, @kusnier

I've tested 'halt', 'suspend' and 'reload', in both an Ubuntu Precise and CentOS 6.4 Virtualbox VMs, on an Ubuntu host machine. Please could you run your tests again?

thanks :)

from vagrant-persistent-storage.

kusnier avatar kusnier commented on May 20, 2024

Tested, no problems found. Nice work!
Please do a pull-request. I will then merge the changes and create a new version.

from vagrant-persistent-storage.

madAndroid avatar madAndroid commented on May 20, 2024

fantastic! thank you very much :D

pull request coming right up ...

from vagrant-persistent-storage.

kusnier avatar kusnier commented on May 20, 2024

Version 0.0.3 released.

from vagrant-persistent-storage.

thasmo avatar thasmo commented on May 20, 2024

Uh ye, didn't have time but nice to see this fixed/merged! :)

from vagrant-persistent-storage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.