Unable to create VDI disk via raw webservice

Discussion about using the VirtualBox API, Tutorials, Samples.
Post Reply
Ch00k
Posts: 3
Joined: 1. Oct 2013, 07:56

Unable to create VDI disk via raw webservice

Post by Ch00k »

For some reason I am not able to create a disk of VDI type when sending request via raw webservice (I'm using Ruby). A disk with all the same parameters but VMDK type is successfully created though. While creating the VDI disk there are no errors from webservice, however the actual file is not created when I call createBaseStorage. With VMDK the file is created. Is there any logging I need to enable somewhere to debug this?
Ch00k
Posts: 3
Joined: 1. Oct 2013, 07:56

Re: Unable to create VDI disk via raw webservice

Post by Ch00k »

I found what the problem was. I was specifying logicalSize of 500000 (500KB) which seems to be too low for VDI. It's strange that it worked with VMDK though.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Unable to create VDI disk via raw webservice

Post by mpack »

VDIs have a granularity of 1MB, at least when using the default header - and this is so ingrained that VBox would likely crash if you tried anything else. Remember that even the extinct floppy drive had a capacity of 1.44MB, so heaven knows what you were planning to do with 500KB capacity hdds. The smallest hdd I ever used (in 1980) was 10MB. Just looking up on wikipedia it appears that the first ever hdd was just under 4MB.
rshaw
Posts: 15
Joined: 11. Feb 2013, 17:04

Re: Unable to create VDI disk via raw webservice

Post by rshaw »

mpack,

I filed a bug which (I believe) wound up changing VDI's megabyte granularity requirement. I could be wrong!

https://www.virtualbox.org/changeset/45 ... ge/VDI.cpp

https://www.virtualbox.org/ticket/11597
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Unable to create VDI disk via raw webservice

Post by mpack »

There's no way they're going to change the VDI granularity, so I'm pretty sure you're wrong. The ticket you posted has to do with snapshots adding one block to the underlying image.

Anyway, you haven't given any reason why the devs would want the granularity to be changed. Nobody ever made a 500KB hdd, so why worry about simulating one? Which paying clients would want this feature?

If you want a smaller granularity, or even an exact size, stick to VMDK.
Post Reply