> Given the name of a box ... under ~/.vagrant.d/boxes you will find a
> file named and containing the metadata_url and one or more
> version-number directories.

Yes, I had seen this.

> These version-number directories contain the unpacked boxes. The
> highest-numbered version is considered the "latest installed
> version". To discover if a more recent version exists, vagrant
> fetches the info via the metadata_url.

And this doesn't work well, with the latest Vagrant version, 2.2.4.

Let me be specific now:

----
    vagrant box list | grep generic/oracle7
    =>
    generic/oracle7 (virtualbox, 1.9.8)
    generic/oracle7 (virtualbox, 1.9.10)

----
    ls -l ~/.vagrant.d/boxes/generic-VAGRANTSLASH-oracle7/
    =>
    ... 102 Apr 19 17:37 1.9.10/
    ... 102 Apr 16 13:59 1.9.8/
    ...  40 Apr 19 17:37 metadata_url

Notice the lexicographic ordering of the box versions; this may be
important for the following, which is "the problem stuff":


----

    vagrant box update --box generic/oracle7
    Checking for updates to 'generic/oracle7
    Latest installed version: 1.9.8

See how 1.9.8 was found to be the latest one, rather than the truly
latest, 1.9.10?  Since there is apparently no place where the "latest
installed version" is recorded, I conclude that the determination is
based on the lexicographic ordering of the installed versions.

And then, of course, 1.9.8 is a "higher" version than 1.9.10; and we
see this (continuing the output of the above 'update' command):

    Version constraints: > 1.9.8
    Provider: virtualbox
    Updating 'generic/oracle7' with provider 'virtualbox' from version
    '1.9.8' to '1.9.10'...
    Loading metadata for box 'https://vagrantcloud.com/generic/oracle7
    Adding box 'generic/oracle7' (v1.9.10) for provider: virtualbox
    The box you're attempting to add already exists. Remove it before
    adding it again or add it with the `--force` flag.

    Name: generic/oracle7
    Provider: virtualbox
    Version: 1.9.10

I have been working around this in my setup framework all right but
this is an annoyance and wrong behavior.

Is there anybody around to fix it?

Thank you for responding!

-- Alex

On Wednesday, April 24, 2019 at 1:22:43 PM UTC-4, Jim McGinness wrote:
>
> Given the name of a box (with the VAGRANTSLASH substitution in place) 
> under ~/.vagrant.d/boxes you will find a file named and containing the 
> metadata_url and one or more version-number directories. These 
> version-number directories contain the unpacked boxes. The highest-numbered 
> version is considered the "latest installed version". To discover if a more 
> recent version exists, vagrant fetches the info via the metadata_url.
>
> If you are asking a slightly different question, "how does vagrant 
> determine the version of a box used to create an existing vm?", the answer 
> is found in ~.vagrant.d/data/machine-index/index which contains the box and 
> version info as part of each entry in the "machines" data structure. This 
> centralized data structure is what lets, for instance, "vagrant 
> global-status" work and is also the reason you get a warning if you move 
> (change the name of) a folder containing a deployed Vagrantfile.
>
>
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vagrant-up/b10fadc3-ca3c-42cd-908e-c62657eed2c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to