0

Development is happening on Mac OSX

Writing a cookbook to partition, format, mount drives dynamically based on drives that are not partitioned, mounted, or formatted, May have been taken out of single drive raid-0 configuration, or may not have been configured through raid controller yet...

While working on writing test cases for cookbook. I am having the following issues.

.kitchen.yml file:

driver:
  name: vagrant
  # ssh:
  #   insert_key: false
  customize:
    cableconnected1: 'on'
      createhd:
      - filename: /tmp/disk1.vdi
        size: 128
    storagectl:
      - name: SATA Controller
        portcount: 4
    storageattach:
      - storagectl: SATA Controller
        port: 0
        device: 0
        type: hdd
        medium: /tmp/disk1.vdi
  privileged: true

Command: kitchen verify

Gets stuck at the following

Output:

    -----> Starting Kitchen (v1.20.0)
    $$$$$$ Deprecated configuration detected:
    require_chef_omnibus
    Run 'kitchen doctor' for details.

    -----> Creating <default-centos-7>...
    (erb):173: warning: constant ::Fixnum is deprecated
    Bringing machine 'default' up with 'virtualbox' provider...
    ==> default: Importing base box 'bento/centos-7'...
    ==> default: Matching MAC address for NAT networking...
    ==> default: Checking if box 'bento/centos-7' is up to date...
    ==> default: Setting the name of the VM: default-centos- 
    7_default_1526333511693_18382
    ==> default: Fixed port collision for 22 => 2222. Now on port 2200.
    ==> default: Clearing any previously set network interfaces...
    ==> default: Preparing network interfaces based on configuration...
        default: Adapter 1: nat
    ==> default: Forwarding ports...
        default: 22 (guest) => 2200 (host) (adapter 1)
    ==> default: Running 'pre-boot' VM customizations...
    ==> default: Booting VM...
    ==> default: Waiting for machine to boot. This may take a few 
    minutes...
       default: SSH address: 127.0.0.1:2200
       default: SSH username: vagrant
       default: SSH auth method: private key
       Timed out while waiting for the machine to boot. This means that
   Vagrant was unable to communicate with the guest machine within
   the configured ("config.vm.boot_timeout" value) time period.

   If you look above, you should be able to see the error(s) that
   Vagrant had when attempting to connect to the machine. These errors
   are usually good hints as to what may be wrong.

   If you're using a custom box, make sure that networking is properly
   working and you're able to connect to the machine. It is a common
   problem that networking isn't setup properly in these boxes.
   Verify that authentication configurations are also setup properly,
   as well.

   If the box appears to be booting properly, you may want to increase
   the timeout ("config.vm.boot_timeout") value.

Will not proceed any further. The adding disk code was taken directly from the kitchen-vagrant documentation for adding a disk. I can remove the createhd, storagectl, & storageattach sections, at which point the vagrant box works as intended. I have verified that the /tmp/disk1.vdi file is created, I also have to delete the file between runs, after a kitchen destroy else I get the following error:

    -----> Starting Kitchen (v1.20.0)
    $$$$$$ Deprecated configuration detected:
    require_chef_omnibus
    Run 'kitchen doctor' for details.

    -----> Creating <default-centos-7>...
    (erb):173: warning: constant ::Fixnum is deprecated
    Bringing machine 'default' up with 'virtualbox' provider...
    ==> default: Checking if box 'bento/centos-7' is up to date...
    ==> default: Machine not provisioned because `--no-provision` is 
    specified.
    Waiting for SSH service on 127.0.0.1:2200, retrying in 3 seconds

It will continue being stuck on retying in 3 seconds indefinitely until I escape the command.

I have tried with and without:

    ssh: 
      insert_key: false

I have tried different formats of files that vagrant is supposed to support as a disk, including .vdi, .vmdk

I have ensured that SATA Controller is the appropriate controller available for the box.

lzukel
  • 31
  • 1
  • 6

2 Answers2

0

This seems issue with vagrant and virtualbox versions. You can find a similar issue here

slashpai
  • 1,141
  • 7
  • 12
0

The reason for this is that kitchen/vagrant tries to bind the OS disk to port 0 of your controller. So the reason it doesn't boot is because there is no boot disk bound!

If you change port: 0 to port: 1 in your example it should boot as expected.

foygl
  • 36
  • 3