<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt"><div><span>you are absolutely right, it works now using a size that is a multiple of 512 bytes</span></div> <div class="qtdSeparateBR"><br><br></div><div style="display: block;" class="yahoo_quoted"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 12pt;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> Klaus Espenlaub <klaus.espenlaub@oracle.com> schrieb am 13:49 Mittwoch, 11.Juni 2014:<br> </font> </div> <br><br> <div class="y_msg_container">You're thinking too complicated... it's really an invalid parameter. The <br clear="none">trouble is the attempt to pass 10000000 to the logicalSize parameter <br
clear="none">(which is arguably a bit underspecified and there could be a better <br clear="none">error message): it's impossible to create an image of this logical size <br clear="none">in any of the image formats I'm aware of, simply because they have a <br clear="none">minimum storage unit of 512 bytes. 10000000 (10MB by the SI definition) <br clear="none">isn't a multiple of 512.<br clear="none"><br clear="none">VBoxManage createhd can't do this either (note that most people use the <br clear="none">--size option to specify the image size in MiBytes, which means that <br clear="none">this issue is hidden, but there's the --sizebytes option)...<br clear="none"><br clear="none">Klaus<br clear="none"><br clear="none">On 10.06.2014 23:30, Maxime Dor wrote:<br clear="none">> What values do you get if you enumerate ISystemProperties::mediumFormats<br clear="none">> <<a shape="rect"
href="https://www.virtualbox.org/sdkref/interface_i_system_properties.html#a3fddf22466361f98b6dc9fc4458d1049" target="_blank">https://www.virtualbox.org/sdkref/interface_i_system_properties.html#a3fddf22466361f98b6dc9fc4458d1049</a>>?<br clear="none">><br clear="none">> *From:*Karoline Haus [mailto:<a shape="rect" ymailto="mailto:karolinehaus@yahoo.de" href="mailto:karolinehaus@yahoo.de">karolinehaus@yahoo.de</a>]<br clear="none">> *Sent:* 10 June 2014 13:17<br clear="none">> *To:* Maxime Dor<br clear="none">> *Cc:* <a shape="rect" ymailto="mailto:vbox-dev@virtualbox.org" href="mailto:vbox-dev@virtualbox.org">vbox-dev@virtualbox.org</a><br clear="none">> *Subject:* Re: [vbox-dev] createBaseStorage() fails with<br clear="none">> VERR_INVALID_PARAMETER<br clear="none">><br clear="none">> I have now figured that the problem seems to be the format itself. If I<br clear="none">> used 'vmdk' instead of 'vdi' then it works. How
is that possible, if<br clear="none">> using VBoxManage I can create VDI images? Do I have to pass a different<br clear="none">> set of parameters when using VDI? Or is a different type of image (<br clear="none">> MediumVariant<br clear="none">> <<a shape="rect" href="https://www.virtualbox.org/sdkref/_virtual_box_8idl.html#adedcbf1a6e5e35fe7a0ca0c4b3447154" target="_blank">https://www.virtualbox.org/sdkref/_virtual_box_8idl.html#adedcbf1a6e5e35fe7a0ca0c4b3447154</a>>)<br clear="none">> required when doing createBaseStorage() with the vdi format? Anyone got<br clear="none">> any pointers?<br clear="none">><br clear="none">> Maxime Dor <<a shape="rect" ymailto="mailto:maxime.dor@altherian.org" href="mailto:maxime.dor@altherian.org">maxime.dor@altherian.org</a> <mailto:<a shape="rect" ymailto="mailto:maxime.dor@altherian.org" href="mailto:maxime.dor@altherian.org">maxime.dor@altherian.org</a>>><br
clear="none">> schrieb am 8:35 Sonntag, 8.Juni 2014:<br clear="none">><br clear="none">> Then I don't know :( no such exception is documented (even tho its<br clear="none">> significance is clear) and I don't know which parameter is wrong or invalid.<br clear="none">><br clear="none">> Hopefully the devs will have an answer.<br clear="none">><br clear="none">> On 6 June 2014 17:01, Karoline Haus <<a shape="rect" ymailto="mailto:karolinehaus@yahoo.de" href="mailto:karolinehaus@yahoo.de">karolinehaus@yahoo.de</a><br clear="none">> <mailto:<a shape="rect" ymailto="mailto:karolinehaus@yahoo.de" href="mailto:karolinehaus@yahoo.de">karolinehaus@yahoo.de</a>>> wrote:<br clear="none">><br clear="none">> Yes it is an array. The type of size is int as there is no long type<br clear="none">> in Python.<br clear="none">><br clear="none">> Maxime Dor <<a
shape="rect" ymailto="mailto:maxime.dor@altherian.org" href="mailto:maxime.dor@altherian.org">maxime.dor@altherian.org</a><br clear="none">> <mailto:<a shape="rect" ymailto="mailto:maxime.dor@altherian.org" href="mailto:maxime.dor@altherian.org">maxime.dor@altherian.org</a>>> schrieb am 15:07 Freitag, 6.Juni<br clear="none">> 2014:<br clear="none">><br clear="none">> Never wrote python, but it looks good. Can you simply confirm<br clear="none">> that self.vboxMgr.constants.MediumVariant_Standard is given in an<br clear="none">> array? (it looks like but not sure).<br clear="none">><br clear="none">> Else, the size needs to be a long, if such type exists in Python.<br clear="none">><br clear="none">> On 6 June 2014 11:28, Karoline Haus <<a shape="rect" ymailto="mailto:karolinehaus@yahoo.de"
href="mailto:karolinehaus@yahoo.de">karolinehaus@yahoo.de</a><br clear="none">> <mailto:<a shape="rect" ymailto="mailto:karolinehaus@yahoo.de" href="mailto:karolinehaus@yahoo.de">karolinehaus@yahoo.de</a>>> wrote:<br clear="none">><br clear="none">> This is the very simple code that fails over and over again and<br clear="none">> I don't know how to fix it:<br clear="none">><br clear="none">> format='vdi'<br clear="none">><br clear="none">> diskImagePath='/home/user/test.vdi'<br clear="none">><br clear="none">> size=10000000<br clear="none">><br clear="none">> hdd = self.vboxMgr.vbox.createHardDisk(format, diskImagePath)<br clear="none">> try:<br
clear="none">> progress = hdd.createBaseStorage(size,<br clear="none">><br clear="none">> (self.vboxMgr.constants.<br clear="none">><br clear="none">> MediumVariant_Standard,))<br clear="none">><br clear="none">> ...<br clear="none">><br clear="none">> This code throws an exception and tells me error code<br clear="none">> VERR_INVALID_PARAMETER as mentioned above. Any idea how to fix this?<br clear="none">><br clear="none">> It fails in createBaseStorage().<br clear="none">><br clear="none">> Thanks!<br clear="none">><br clear="none">> Maxime Dor <<a shape="rect" ymailto="mailto:maxime.dor@altherian.org"
href="mailto:maxime.dor@altherian.org">maxime.dor@altherian.org</a><br clear="none">> <mailto:<a shape="rect" ymailto="mailto:maxime.dor@altherian.org" href="mailto:maxime.dor@altherian.org">maxime.dor@altherian.org</a>>> schrieb am 8:58 Freitag,<br clear="none">> 6.Juni 2014:<br clear="none">><br clear="none">> Provide the part of your code that fails please, else it's a bit<br clear="none">> hard to give you pointers.<br clear="none">><br clear="none">> On 5 June 2014 16:25, Karoline Haus <<a shape="rect" ymailto="mailto:karolinehaus@yahoo.de" href="mailto:karolinehaus@yahoo.de">karolinehaus@yahoo.de</a><div class="yqt1599785112" id="yqtfd37224"><br clear="none">> <mailto:<a shape="rect" ymailto="mailto:karolinehaus@yahoo.de"
href="mailto:karolinehaus@yahoo.de">karolinehaus@yahoo.de</a>>> wrote:<br clear="none">><br clear="none">> Hi I'm trying to create a virtual hard drive using the<br clear="none">> Python API.<br clear="none">><br clear="none">> I can successully create the IMedium object using<br clear="none">> IVirtualBox::createHardDisk() but then when I try to call<br clear="none">> createBaseStorage() on that object, I can an error saying<br clear="none">> "Error in module Medium (VERR_INVALID_PARAMETER)" but I do<br clear="none">> not get any further details on what the problem is.<br clear="none">><br clear="none">>
According to the SDK documentation, the only error for this<br clear="none">> function should be if the medium format is not supported by<br clear="none">> my system ("The variant of storage creation operation is not<br clear="none">> supported."), but I am just trying to create a VDI disk, and<br clear="none">> when I list the HDD backends using VBoxManage, it is<br clear="none">> definitely supported. The path I'm trying to create the<br clear="none">> virtual disk under is also accessible and writable.<br clear="none">><br clear="none">> What else can the problem be? I do not seem to be able to<br
clear="none">> dig deeper into this. I'm using the /MediumVariant_Standard/<br clear="none">> variant, so there is nothing special about this either.<br clear="none">><br clear="none">> Any pointers would be really appreciated.<br clear="none">><br clear="none"><br clear="none">_______________________________________________<br clear="none">vbox-dev mailing list<br clear="none"><a shape="rect" ymailto="mailto:vbox-dev@virtualbox.org" href="mailto:vbox-dev@virtualbox.org">vbox-dev@virtualbox.org</a><br clear="none"><a shape="rect" href="https://www.virtualbox.org/mailman/listinfo/vbox-dev" target="_blank">https://www.virtualbox.org/mailman/listinfo/vbox-dev</a><br clear="none"></div><br><br></div> </div> </div> </div> </div></body></html>