rancher / vagrant

Vagrant file to stand up a Local Rancher install with 3 nodes
81 stars 56 forks source link

"Could not rename the directory .../VirtualBox VMs/ubuntu-14.04-amd64_1519329807399_87133' to '.../VirtualBox VMs/master' to save the settings file (VERR_ALREADY_EXISTS) #40

Closed stefanlasiewski closed 6 years ago

stefanlasiewski commented 6 years ago

I'm trying to run the rancher-vagrant project for the first time, but it is not working for me. I'm not a Vagrant master, but I understand correctly, the project may be renaming the image incorrectly as shown below with the VERR_ALREADY_EXISTS error.

I'll look into this more, and I will contribute a fix if I can. But in the meanwhile, does anyone know what's going on here?

My Environment is fairly standard MacOS High Sierra host running with up-to-date Vagrant and Virtualbox software.

stefanl@stefanl:Vagrant $ vagrant --version
Vagrant 2.0.2
stefanl@stefanl:Vagrant $ VBoxManage --version
5.2.6r120293

And just to verify, the Ubuntu directory specified below doesn't exist already:

ls -ld "/Users/stefanl/VirtualBox VMs/ubuntu* /Users/stefanl/VirtualBox VMs/master*"
ls: /Users/stefanl/VirtualBox VMs/ubuntu* /Users/stefanl/VirtualBox VMs/master*: No such file or directory
stefanl@stefanl:rancher-vagrant $

But if I follow the procedure to get this installed, the installation fails.

stefanl@stefanl:Vagrant $ git clone https://github.com/rancher/vagrant.git rancher-vagrant
Cloning into 'rancher-vagrant'...
remote: Counting objects: 341, done.
remote: Total 341 (delta 0), reused 0 (delta 0), pack-reused 341
Receiving objects: 100% (341/341), 225.31 KiB | 3.58 MiB/s, done.
Resolving deltas: 100% (190/190), done.
stefanl@stefanl:Vagrant $ cd rancher-vagrant/
stefanl@stefanl:rancher-vagrant $ vagrant up
Config: {"orchestrator"=>"cattle", "network_mode"=>"normal", "sslenabled"=>"false", "ssldns"=>"server.rancher.vagrant", "version"=>"latest", "rancher_env_vars"=>"", "agent_version"=>"v1.2.5", "ROS_version"=>"1.0.3", "master"=>{"cpus"=>1, "memory"=>1024}, "server"=>{"count"=>1, "cpus"=>1, "memory"=>2048}, "node"=>{"count"=>3, "cpus"=>1, "memory"=>2048}, "ip"=>{"master"=>"172.22.101.100", "server"=>"172.22.101.101", "node"=>"172.22.101.111"}, "linked_clones"=>true, "net"=>{"private_nic_type"=>"82545EM", "network_type"=>"private_network"}, "keys"=>{"public_key"=>"", "private_key"=>""}, "external_access"=>{"enabled"=>false, "ssh_port"=>2277, "http_port"=>80, "https_port"=>443}}

Bringing machine 'master' up with 'virtualbox' provider...
Bringing machine 'server-01' up with 'virtualbox' provider...
Bringing machine 'node-01' up with 'virtualbox' provider...
Bringing machine 'node-02' up with 'virtualbox' provider...
Bringing machine 'node-03' up with 'virtualbox' provider...
==> master: Importing base box 'williamyeh/ubuntu-trusty64-docker'...
==> master: Matching MAC address for NAT networking...
==> master: Checking if box 'williamyeh/ubuntu-trusty64-docker' is up to date...
==> master: Setting the name of the VM: master
The name of your virtual machine couldn't be set because VirtualBox
is reporting another VM with that name already exists. Most of the
time, this is because of an error with VirtualBox not cleaning up
properly. To fix this, verify that no VMs with that name do exist
(by opening the VirtualBox GUI). If they don't, then look at the
folder in the error message from VirtualBox below and remove it
if there isn't any information you need in there.

VirtualBox error:

VBoxManage: error: Could not rename the directory '/Users/stefanl/VirtualBox VMs/ubuntu-14.04-amd64_1519329807399_87133' to '/Users/stefanl/VirtualBox VMs/master' to save the settings file (VERR_ALREADY_EXISTS)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component SessionMachine, interface IMachine, callee nsISupports
VBoxManage: error: Context: "SaveSettings()" at line 3105 of file VBoxManageModifyVM.cpp
stefanl@stefanl:rancher-vagrant $
stefanlasiewski commented 6 years ago

Deleting this. Turns out my problem was due to an earlier failed install which left behind a bogus image at /Users/stefanl/VirtualBox VMs/master* . Sorry!