rdbreak / rhcsa8env

This is a RHCSA8 study environment built with Vagrant/Ansible
https://join.slack.com/t/redhat-certs/shared_invite/zt-7ju3rz7b-_G3Njp3PDwdBG_81SwPeLA
MIT License
295 stars 176 forks source link

Setup fails because 'SATA Controller' already exists #15

Closed theJaxon closed 4 years ago

theJaxon commented 4 years ago

Virtualbox Version: 6.1.6_Ubuntu r137129 Vagrant Version: 2.2.9 OS: Ubuntu 20.04 LTS

When i run vagrant up command the following issue appears and it stops vagrant from continuing

A customization command failed:

["storagectl", :id, "--name", "SATA Controller", "--add", "sata", "--portcount", 2]

The following error was experienced:

#<Vagrant::Errors::VBoxManageError: There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["storagectl", "bc0931a1-b0b1-4589-a847-a4d39685910e", "--name", "SATA Controller", "--add", "sata", "--portcount", "2"]

Stderr: VBoxManage: error: Storage controller named 'SATA Controller' already exists
VBoxManage: error: Details: code VBOX_E_OBJECT_IN_USE (0x80bb000c), component SessionMachine, interface IMachine, callee nsISupports
VBoxManage: error: Context: "AddStorageController(Bstr(pszCtl).raw(), StorageBus_SATA, ctl.asOutParam())" at line 1078 of file VBoxManageStorageController.cpp
>

Please fix this customization and try again.
rdbreak commented 4 years ago

Thanks for the info!

Was this a first set up or did you pull the changes down then try to set it up?

theJaxon commented 4 years ago

This was the first set up, all i did is clone the repo, cd into rhcsa8env directory then vagrant up and i ended with that error, a similar error was also mentioned in issue #13

rdbreak commented 4 years ago

I just made some changes to the drive config that may be causing it. I'll take a look

rdbreak commented 4 years ago

I'm not getting the error on Ubuntu 18. I'll try on 20.

rdbreak commented 4 years ago

I'm not receiving the error on the following config:

Virtualbox Version: 6.1.12 r139181
Vagrant Version: 2.2.9
OS: Ubuntu 20.04 LTS

Can you run apt update -y && apt upgrade -y && vagrant destroy -f, reboot, then try to build the environment again?

theJaxon commented 4 years ago

I think because i've got different vagrant machines running that causes the issue, for me the problem wasn't resolved after running vagrant destroy -f , also same behavior happened on windows but the difference was that i was able to get all the 3 machines running, doing vagrant halt then vagrant up again i ended up with the same error. i wanted to skip setting up samba and nfs (server side) but ended up doing them anyway and now i'm able to see the shares on the client machine

Vagrant.configure("2") do |config|
  config.vm.synced_folder ".", "/vagrant", type: "rsync"
  config.vm.box_check_update = false

  config.vm.define "server" do |server|
    server.vm.box = "bento/centos-8"
    server.vm.hostname = "server"
    server.vm.network "private_network", ip: "192.168.50.210"
    server.vm.provision "shell", inline: <<-SHELL
      sudo yum update 
      sudo yum install -y vdo kmod-kvdo httpd
      sudo echo "192.168.50.211 nfs.com" >> /etc/hosts
  SHELL
  end

  config.vm.define "nfs" do |nfs|
    nfs.vm.box = "bento/centos-8"
    nfs.vm.hostname = "nfs"
    nfs.vm.network "private_network", ip: "192.168.50.211"
    nfs.vm.provision "shell", inline: <<-SHELL
      sudo yum update 
      sudo yum install -y nfs-utils cifs-utils samba-client samba
      sudo systemctl enable --now {nfs-server,smb,firewalld}
      sudo firewall-cmd --permanent --add-service=nfs
      sudo firewall-cmd --permanent --add-service=mountd
      sudo firewall-cmd --permanent --add-service=rpc-bind
      sudo firewall-cmd --permanent --add-service=samba
      sudo firewall-cmd --reload
      sudo mkdir -v /nfs /cifs
      sudo echo "/nfs   *(rw,no_root_squash)" >> /etc/exports
      sudo systemctl restart nfs-server
      sudo useradd samba
      sudo chown samba /cifs && sudo chmod 770 /cifs
      sudo echo '''
                [cifs]
                  comment = samba share 
                  path = /cifs 
                  write list = samba
                ''' >> /etc/samba/smb.conf
  SHELL

  end
end

Am i missing something with this setup or its just good enough to start practicing ?

rdbreak commented 4 years ago

If you have different versions of vagrant running with different boxes then that will cause the issue you're experiencing. Erasing all of the different boxes and starting fresh should get rid of the error. Same on Windows

theJaxon commented 4 years ago

Unfortunately i won't be able to erase all the different boxes, i'm going to close the issue and hopefully you'll be able to make it work without having to start from a completely fresh vagrant setup at some point in the future, thank you.

rdbreak commented 4 years ago

No problem. Thanks for submitting the issue!

abhijith-b commented 4 years ago

i'm also having the same issue. it worked fine when i set it up for the first time. but if i type vagrant halt and try to turn it on again i get this error after the line server2: Running 'pre-boot' VM customizations....
server1 and repo are working fine though.

os : fedora 32 vagrant : 2.2.9 vbox : 6.1.12 r139181