Qarik-Group / bucc

The fastest way to get a BUCC (BOSH, UAA Credhub and Concourse)
Apache License 2.0
135 stars 46 forks source link

Error on initial install: can't mount disk #205

Closed rrileyca closed 2 years ago

rrileyca commented 4 years ago

On Mac, bucc up --lite fails with an error code regarding mounting a disk.

Versions

sw_vers -productVersion returns 10.15.3 From Virtual Box GUI: 6.1.4 r136177 (Qt5.6.3) git rev-parse HEAD returns b1f1ac6140fc0b3f8e16f77c11816e9e14558ec6 direnv --version returns 2.21.2

Reproduce problem:

bucc up --lite

Output:

Started deploying
  Waiting for the agent on VM 'vm-754b82e4-d436-4718-5419-5b53ab73e52b'... Finished (00:00:00)
  Stopping jobs on instance 'unknown/0'... Finished (00:00:01)
  Deleting VM 'vm-754b82e4-d436-4718-5419-5b53ab73e52b'... Finished (00:00:00)
  Creating VM for instance 'bosh/0' from stemcell 'sc-0c5326db-147f-4776-746a-68224e83927d'... Finished (00:00:00)
  Waiting for the agent on VM 'vm-6993f1b4-6154-4317-7ff1-57f1f96a8def' to be ready... Finished (00:00:30)
  Creating disk... Finished (00:00:00)
  Attaching disk 'disk-50990733-1997-4520-4cdc-d77bc9f4780b' to VM 'vm-6993f1b4-6154-4317-7ff1-57f1f96a8def'... Failed (00:01:12)
Failed deploying (00:02:41)

Cleaning up rendered CPI jobs... Finished (00:00:00)

Deploying:
  Creating instance 'bosh/0':
    Updating instance disks:
      Updating disks:
        Deploying disk:
          Mounting disk:
            Sending 'get_task' to the agent:
              Agent responded with error: Action Failed get_task: Task f6d4db30-ed95-4238-5a36-ada8b6fc9d72 result: Mounting persistent disk: Getting real device path: Timed out getting real device path for '1ATA'

Exit code 1
ramonskie commented 4 years ago

seems to me there is something wrong with your virtualbox installation.

can you try to create a vm in virtualbox and add a disk to it manually?

rrileyca commented 4 years ago

I can add the disks manually through the GUI. I noticed that when I was browsing folders that VirtualBox didn't have permission to access the disks (fixed by doing Settings > Security and Privacy > Privacy > Full Disk Access).

Still no difference in bucc though. Same error.

ramonskie commented 4 years ago

can you try to delete purge your virtualbox install. and then install the latest version from the virtualbox website?

rrileyca commented 4 years ago

Just tried that, same result as before.

Interesting logs from VBoxSVC.log:

00:02:21.310739 nspr-4   ERROR [COM]: aRC=NS_ERROR_FAILURE (0x80004005) aIID={85632c68-b5bb-4316-a900-5eb28d3413df} aComponent={SessionMachine} aText={This machine does not have any snapshots}, preserve=false aResultDetail=0
00:02:21.404978 nspr-3   ERROR [COM]: aRC=VBOX_E_OBJECT_NOT_FOUND (0x80bb0001) aIID={85632c68-b5bb-4316-a900-5eb28d3413df} aComponent={SessionMachine} aText={No storage device attached to device slot 0 on port 1 of controller 'IDE'}, preserve=false aResultDetail=0
00:02:21.405624 nspr-4   ERROR [COM]: aRC=VBOX_E_OBJECT_NOT_FOUND (0x80bb0001) aIID={85632c68-b5bb-4316-a900-5eb28d3413df} aComponent={SessionMachine} aText={No storage device attached to device slot 0 on port 1 of controller 'IDE'}, preserve=false aResultDetail=0

And logs from the virtual machine's VBox.log:

00:00:12.041013 PIIX3 ATA: Ctl#0: RESET, DevSel=0 AIOIf=0 CmdIf0=0xc8 (-1 usec ago) CmdIf1=0xc8 (-1 usec ago)
00:00:12.041098 PIIX3 ATA: Ctl#0: finished processing RESET
00:00:31.491013 Changing the VM state from 'RUNNING' to 'SUSPENDING'
00:00:31.496433 PDMR3Suspend: 5 076 861 ns run time
00:00:31.496453 Changing the VM state from 'SUSPENDING' to 'SUSPENDED'
00:00:31.496466 Console: Machine state changed to 'Paused'
00:00:31.550669 DrvVD: Flushes will be ignored
00:00:31.550686 DrvVD: Async flushes will be passed to the disk
00:00:31.552382 VD: Opening the disk took 1687044 ns
00:00:31.552426 PIIX3 ATA: LUN#2: disk, PCHS=16383/16/63, total number of sectors 134217728
00:00:31.552579 ************************* CFGM dump *************************
00:00:31.552580 [/Devices/piix3ide/0/LUN#2/] (level 0)
00:00:31.552582   Driver <string>  = "VD" (cb=3)
00:00:31.552583
00:00:31.552583 [/Devices/piix3ide/0/LUN#2/Config/] (level 1) (restricted root)
00:00:31.552585   Format    <string>  = "VMDK" (cb=5)
00:00:31.552585   Mountable <integer> = 0x0000000000000000 (0)
00:00:31.552586   Path      <string>  = "/Users/rnriley/.bosh_virtualbox_cpi/disks/disk-d572ce5f-6e5a-402b-5875-88c691a36d23/disk.vmdk" (cb=94)
00:00:31.552587   Type      <string>  = "HardDisk" (cb=9)
00:00:31.552588
00:00:31.552588 ********************* End of CFGM dump **********************
00:00:31.590064 Changing the VM state from 'SUSPENDED' to 'RESUMING'
00:00:31.591314 Changing the VM state from 'RESUMING' to 'RUNNING'
00:00:31.591335 Console: Machine state changed to 'Running'
00:00:42.733581 PIIX3 ATA: Ctl#0: RESET, DevSel=0 AIOIf=0 CmdIf0=0xc8 (-1 usec ago) CmdIf1=0xe7 (-1 usec ago)
00:00:42.733697 PIIX3 ATA: Ctl#0: finished processing RESET

VBox.log VBoxSVC.log

rrileyca commented 4 years ago

Oh wow. I just nuked my install and installed an older version of Virtualbox (6.0.18), did a bucc down && bucc clean and tried re-installing... No problems at all. I'll use this as a workaround for now, but the original issue still exists.

ramonskie commented 4 years ago

probably has something todo with Please also use version 6.0 if you need to run VMs with software virtualization, as this has been discontinued in 6.1. Version 6.0 will remain supported until July 2020.

need to investigate further this has unfortunately not much to with bucc it self but more the virtualbox-cpi itself

edit: https://github.com/cloudfoundry/bosh-deployment/issues/378 https://www.virtualbox.org/ticket/19251

bwinter commented 4 years ago

To revert to the older 6.0:

If necessary, uninstall 6.1:

brew cask uninstall virtualbox

Install 6.0:

brew cask reinstall 'https://raw.githubusercontent.com/Homebrew/homebrew-cask/77e6ab7099cd3c07ef21442e9f421e33a07a415a/Casks/virtualbox.rb'
ipa-bak commented 3 years ago

@ramonskie , I run into the same problem and I thing I found the root problem and what needs to be changed for compatibility with modern VirtualBox versions.

Unfortunately I lack the skills to propose a PR / actual code changes (I know nothing about GO). But I documented my findings here: https://github.com/cppforlife/bosh-virtualbox-cpi-release/issues/18. Someone familiar with the GO language and how a CPI works should be able to easily fix the problem.

ramonskie commented 2 years ago

stale issue please reopen if necessary