Skip to content

Conversation

@kakkoko
Copy link

@kakkoko kakkoko commented Apr 24, 2018

vagrant-mutate cannot convert some virtualbox images:

% vagrant mutate ubuntu/xenial64 bhyve
Converting ubuntu/xenial64 from virtualbox to bhyve.
    (100.00/100%)
/home/kakkoko/.vagrant.d/gems/2.4.4/gems/vagrant-mutate-1.2.0/lib/vagrant-mutate/box/virtualbox.rb:153:in `size_in_bytes': Unknown unit byte * 2^20 (ArgumentError)
        from /home/kakkoko/.vagrant.d/gems/2.4.4/gems/vagrant-mutate-1.2.0/lib/vagrant-mutate/box/virtualbox.rb:69:in `block in memory'
        from /usr/local/lib/ruby/2.4/rexml/element.rb:927:in `block in each'
        from /usr/local/lib/ruby/2.4/rexml/xpath.rb:68:in `each'
        from /usr/local/lib/ruby/2.4/rexml/xpath.rb:68:in `each'
        from /usr/local/lib/ruby/2.4/rexml/element.rb:927:in `each'
        from /home/kakkoko/.vagrant.d/gems/2.4.4/gems/vagrant-mutate-1.2.0/lib/vagrant-mutate/box/virtualbox.rb:67:in `memory'
        from /home/kakkoko/.vagrant.d/gems/2.4.4/gems/vagrant-mutate-1.2.0/lib/vagrant-mutate/converter/bhyve.rb:24:in `generate_vagrantfile'
        from /home/kakkoko/.vagrant.d/gems/2.4.4/gems/vagrant-mutate-1.2.0/lib/vagrant-mutate/converter/converter.rb:61:in `write_vagrantfile'
        from /home/kakkoko/.vagrant.d/gems/2.4.4/gems/vagrant-mutate-1.2.0/lib/vagrant-mutate/converter/converter.rb:42:in `convert'
        from /home/kakkoko/.vagrant.d/gems/2.4.4/gems/vagrant-mutate-1.2.0/lib/vagrant-mutate/mutate.rb:50:in `execute'
        from /usr/local/lib/ruby/gems/2.4/gems/vagrant-2.0.3/lib/vagrant/cli.rb:46:in `execute'
        from /usr/local/lib/ruby/gems/2.4/gems/vagrant-2.0.3/lib/vagrant/environment.rb:269:in `cli'
        from /usr/local/lib/ruby/gems/2.4/gems/vagrant-2.0.3/bin/vagrant:154:in `<top (required)>'
        from /usr/local/bin/vagrant:23:in `load'
        from /usr/local/bin/vagrant:23:in `<main>'

OVF(DMTF DSP0004(*1)) defines flexible format of programatic units.
(for instance, "byte * 2^10" == "kibibytes")
This commit supports three often-used representation:

  • "byte * 2^10" (means "kibibytes")
  • "byte * 2^20" (means "mebibytes")
  • "byte * 2^30" (means "gibibytes")

(*1) http://www.dmtf.org/standards/published_documents/DSP0004_2.7.0.pdf

DMTF DSP0004(*1) defines flexible format of programatic units.
(for instance, "byte * 2^10" == "kibibytes")
This commit supports three often-used representation:

  * "byte * 2^10" (means "kibibytes")
  * "byte * 2^20" (means "mebibytes")
  * "byte * 2^30" (means "gibibytes")

If you need complete support of DSP0004, you must implement more complex
interpreter.

(*1) http://www.dmtf.org/standards/published_documents/DSP0004_2.7.0.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant