Thanks I noticed that as well. 
Switched to creating a SATA controller and attaching drives to it.

The metadata problem may have been part of my headache. After trying Karl's 
examples and them working out of the box, I deleted the box in virtualbox 
and deleted my .vagrant directory as well.
Then things started to work more correctly... 

Discovered a typo in my "Unless file.exists" line  ( must include the path, 
duh) 

See my response to Karl for the correct Vagrantfile. 

On Tuesday, October 15, 2019 at 3:52:29 PM UTC-5, Salty Vagrant wrote:
>
> I had to resort to a Google search. Look at 
> https://coderwall.com/p/8m--dq/purge-deleted-hard-disks-from-virtual-box 
> This shows how to purge deleted disks. vagrant destroy does not purge 
> custom disks and simply deleting the vdi does not correctly manage 
> virtual box metadata.
>
> You still have an issue with storageattach; you need to specify device 
> and port. I don’t have time to research this at the moment but I’m sure 
> Google will provide.
>
> On 15 Oct 2019, at 17:30, Brian Carpenter wrote:
>
> There are no extra drives and the initial system drive is called: 
> centos-7-1-1.x86_64.vmdk
>
> Tried changing 
>  (1..5).each do |hd|
>
> to 
>  (2..5).each do |hd|
>
> And got the same thing
>
> A customization command failed:
>
> ["createmedium", "--filename", "./disk2.vdi", "--variant", "Fixed", 
> "--size", 20480]
>
> 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: ["createmedium", "--filename", "./disk2.vdi", "--variant", 
> "Fixed", "--size", "20480"]
>
> Stderr: 0%...
> Progress state: VBOX_E_FILE_ERROR
> VBoxManage: error: Failed to create medium
> VBoxManage: error: Could not create the medium storage unit 
> '/home/brian/projects/centos/disk2.vdi'.
> VBoxManage: error: VDI: cannot create image 
> '/home/brian/projects/centos/disk2.vdi' (VERR_ALREADY_EXISTS)
> VBoxManage: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component 
> MediumWrap, interface IMedium
> VBoxManage: error: Context: "RTEXITCODE handleCreateMedium(HandlerArg*)" 
> at line 462 of file VBoxManageDisk.cpp
>
>
> On Tue, Oct 15, 2019 at 11:11 AM Salty Vagrant <[email protected] 
> <javascript:>> wrote:
>
>> My guess would be that the default/system drive is created as disk1.vdi. 
>> Try starting at disk2.
>>
>> On 11 Oct 2019, at 15:16, Brian Carpenter wrote:
>>
>> I am trying to provision identical drives for a ZFS sandbox vm to learn 
>> ZFS but it seems to only create the first drive and then fail
>>
>> Vagrant.configure("2") do |config|
>>   config.vm.box = "centos/7"
>>   (1..5).each do |hd|
>>       config.vm.provider :virtualbox do |v|
>>                 puts "harddrive #{hd}"
>>                 v.customize ['createmedium', '--filename', 
>> "./disk#{hd}.vdi",'--variant', 'Fixed', '--size', 20 * 1024]
>>
>>                 v.customize ['storageattach', :id,  '--storagectl', 
>> 'IDE', '--device', hd, '--type', 'hdd', '--medium', "./disk#{hd}.vdi"]
>>   end
>>   end
>> end
>>
>>
>> Output....
>> $vagrant up
>>
>> harddrive 1
>> harddrive 2
>> harddrive 3
>> harddrive 4
>> harddrive 5
>> harddrive 1
>> harddrive 2
>> harddrive 3
>> harddrive 4
>> harddrive 5
>> harddrive 1
>> harddrive 2
>> harddrive 3
>> harddrive 4
>> harddrive 5
>> Bringing machine 'default' up with 'virtualbox' provider...
>> ==> default: Checking if box 'centos/7' version '1905.1' is up to date...
>> ==> default: Clearing any previously set forwarded ports...
>> ==> default: Clearing any previously set network interfaces...
>> ==> default: Preparing network interfaces based on configuration...
>>     default: Adapter 1: nat
>> ==> default: Forwarding ports...
>>     default: 22 (guest) => 2222 (host) (adapter 1)
>> ==> default: Running 'pre-boot' VM customizations...
>> A customization command failed:
>>
>> ["createmedium", "--filename", "./disk1.vdi", "--variant", "Fixed", 
>> "--size", 20480]
>>
>> 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: ["createmedium", "--filename", "./disk1.vdi", "--variant", 
>> "Fixed", "--size", "20480"]
>>
>> Stderr: 0%...
>> Progress state: VBOX_E_FILE_ERROR
>> VBoxManage: error: Failed to create medium
>> VBoxManage: error: Could not create the medium storage unit 
>> '/home/brian/projects/centos/disk1.vdi'.
>> VBoxManage: error: VDI: cannot create image 
>> '/home/brian/projects/centos/disk1.vdi' (VERR_ALREADY_EXISTS)
>> VBoxManage: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), 
>> component MediumWrap, interface IMedium
>> VBoxManage: error: Context: "RTEXITCODE handleCreateMedium(HandlerArg*)" 
>> at line 462 of file VBoxManageDisk.cpp
>> >
>>
>> Please fix this customization and try again.
>>
>>
>>
>> -- 
>> 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] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/vagrant-up/126acb4c-ad09-40bf-bc11-8e15c84a091a%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/vagrant-up/126acb4c-ad09-40bf-bc11-8e15c84a091a%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> -- 
>> 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 a topic in the 
>> Google Groups "Vagrant" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/vagrant-up/yoheUgqb5TE/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> [email protected] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/vagrant-up/5DC3E3F9-3A6B-4EBB-884A-98A2FBB4683A%40gmail.com
>>  
>> <https://groups.google.com/d/msgid/vagrant-up/5DC3E3F9-3A6B-4EBB-884A-98A2FBB4683A%40gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>
>
> -- 
>
>
>
> [image: Western Oklahoma State College Logo] <https://www.wosc.edu/>Brian 
> Carpenter 
> Information Systems Specialist
> Western Oklahoma State College <https://www.wosc.edu/>
> 2801 N. Main St.  *|*  Altus, OK 73521 
> <https://www.google.com/maps/place/Western+Oklahoma+State+College+Main+Building,+Altus,+OK+73521/@34.6694147,-99.3372287,18.87z/data=!3m1!5s0x87ab653a7bb9cc6f:0xd1063be3c99517db!4m5!3m4!1s0x87ab653a7bbd0569:0xc65b112658cc9ef!8m2!3d34.6689441!4d-99.336963>
> (580) 477-7919  *|*  Office: HLC 126
> [image: wosc facebook] <https://www.wosc.edu/facebook> [image: wosc 
> instagram] <https://www.wosc.edu/instagram> [image: wosc twitter] 
> <https://www.wosc.edu/twitter> [image: wosc snapchat] 
> <https://snapchat.com/add/woscevents>
>
> The mission of Western Oklahoma State College is to provide high quality 
> education, support student success, and empower individuals to become 
> productive members of local, regional, and global communities.
>
> -- 
> 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] <javascript:>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/vagrant-up/CADwO3JMcN4StbG1TL9M_z6n3U%3DXYQ4eaCHBMbyhEDVecVxBNzg%40mail.gmail.com
>  
> <https://groups.google.com/d/msgid/vagrant-up/CADwO3JMcN4StbG1TL9M_z6n3U%3DXYQ4eaCHBMbyhEDVecVxBNzg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
>

-- 
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/219a9a2a-fa8b-4057-8984-f335b1e5ca93%40googlegroups.com.

Reply via email to