<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt"><div style="" class=""><span style="" class="">I have now figured that the problem seems to be the format itself. If I used 'vmdk' instead of 'vdi' then it works. How is that possible, if using VBoxManage I can create VDI images? Do I have to pass a different set of parameters when using VDI? Or is a different type of image (</span><br style="" class=""><a style="" class="" href="https://www.virtualbox.org/sdkref/_virtual_box_8idl.html#adedcbf1a6e5e35fe7a0ca0c4b3447154">MediumVariant</a>) required when doing createBaseStorage() with the vdi format? Anyone got any pointers?<br></div> <div class="qtdSeparateBR"><br><br></div><div style="display: block;" class="yahoo_quoted"> <div class="" style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size:
 12pt;"> <div class="" style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 12pt;"> <div style="" class="" dir="ltr"> <font style="" class="" face="Arial" size="2"> Maxime Dor <maxime.dor@altherian.org> schrieb am 8:35 Sonntag, 8.Juni 2014:<br style="" class=""> </font> </div>  <br style="" class=""><br style="" class=""> <div style="" class=""><div style="" class="" id="yiv1920745303"><div style="" class=""><div style="" class="" dir="ltr"><div class="" style="font-family:verdana, sans-serif;">​Then I don't know :( no such exception is documented (even tho its significance is clear) and I don't know which parameter is wrong or invalid.</div>

<div class="" style="font-family:verdana, sans-serif;">Hopefully the devs will have an answer.​</div></div><div style="" class="" id="yiv1920745303yqt40912"><div style="" class=""><br style="" class="" clear="none"><br style="" class="" clear="none"><div style="" class="">On 6 June 2014 17:01, Karoline Haus <span style="" class="" dir="ltr"><<a style="" class="" rel="nofollow" shape="rect" ymailto="mailto:karolinehaus@yahoo.de" target="_blank" href="mailto:karolinehaus@yahoo.de">karolinehaus@yahoo.de</a>></span> wrote:<br style="" class="" clear="none">

<blockquote class="" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div style="" class=""><div class="" style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;">

<div style="" class=""><span style="" class="">Yes it is an array. The type of size is int as there is no long type in Python.</span></div> <div style="" class=""><br style="" class="" clear="none"><br style="" class="" clear="none"></div><div class="" style="display:block;"> <div class="" style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;">

 <div class="" style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;"> <div style="" class="" dir="ltr"> <font style="" class="" face="Arial"> Maxime Dor <<a style="" class="" rel="nofollow" shape="rect" ymailto="mailto:maxime.dor@altherian.org" target="_blank" href="mailto:maxime.dor@altherian.org">maxime.dor@altherian.org</a>> schrieb am 15:07 Freitag, 6.Juni 2014:<br style="" class="" clear="none">

 </font> </div><div style="" class=""><div style="" class="">  <br style="" class="" clear="none"><br style="" class="" clear="none"> <div style="" class=""><div style="" class=""><div style="" class=""><div style="" class="" dir="ltr"><div class="" style="font-family:verdana, sans-serif;">Never wrote python, but it looks good. Can you simply
 confirm that self.vboxMgr.constants.MediumVariant_Standard is given in an array? (it looks like but not sure).</div>

<div class="" style="font-family:verdana, sans-serif;">Else, the size needs to be a long, if such type exists in Python.</div></div><div style="" class=""><div style="" class=""><br style="" class="" clear="none"><br style="" class="" clear="none"><div style="" class="">On 6 June 2014 11:28, Karoline Haus <span style="" class="" dir="ltr"><<a style="" class="" rel="nofollow" shape="rect" ymailto="mailto:karolinehaus@yahoo.de" target="_blank" href="mailto:karolinehaus@yahoo.de">karolinehaus@yahoo.de</a>></span> wrote:<br style="" class="" clear="none">



<blockquote class="" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div style="" class=""><div class="" style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;">



<div style="" class=""><span style="" class="">This is the very simple code that fails over and over again and I don't know how to fix it:</span></div><div class="" style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;">



<br style="" class="" clear="none"><span style="" class=""></span></div><div class="" style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;"><span style="" class="">format='vdi'</span></div>



<div class="" style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;"><span style="" class="">diskImagePath='/home/user/test.vdi'</span></div>



<div class="" style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;"><span style="" class="">size=10000000</span></div><div class="" style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;">



<span style="" class=""><br style="" class="" clear="none"></span></div><div class="" style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;"><span style="" class="">hdd = self.vboxMgr.vbox.createHardDisk(format, diskImagePath)<br style="" class="" clear="none">



        try:<br style="" class="" clear="none">            progress = hdd.createBaseStorage(size,<br style="" class="" clear="none">                                             (self.vboxMgr.constants.<br style="" class="" clear="none">                                              MediumVariant_Standard,))<br style="" class="" clear="none">

</span></div>

<div class="" style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;">...</div><div class="" style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;">



<br style="" class="" clear="none"><span style="" class=""></span></div><div class="" style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;"><span style="" class="">This code throws an exception and tells me error code VERR_INVALID_PARAMETER as mentioned above. Any idea how to fix this?</span></div>



<div class="" style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;">It fails in createBaseStorage().<br style="" class="" clear="none">

<span style="" class=""></span></div>

<div class="" style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;"><span style="" class="">Thanks!<br style="" class="" clear="none"></span></div> <div style="" class="">

<br style="" class="" clear="none"><br style="" class="" clear="none"></div>

<div class="" style="display:block;"> <div class="" style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;"> <div class="" style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;">



 <div style="" class="" dir="ltr"> <font style="" class="" face="Arial"> Maxime Dor <<a style="" class="" rel="nofollow" shape="rect" ymailto="mailto:maxime.dor@altherian.org" target="_blank" href="mailto:maxime.dor@altherian.org">maxime.dor@altherian.org</a>> schrieb am 8:58 Freitag, 6.Juni 2014:<br style="" class="" clear="none">

 </font> </div><div style="" class=""><div style="" class="">
  <br style="" class="" clear="none">
<br style="" class="" clear="none"> <div style="" class=""><div style="" class=""><div style="" class=""><div style="" class="" dir="ltr"><div class="" style="font-family:verdana, sans-serif;">Provide the part of your code that fails please, else it's a bit hard to give you pointers.</div></div><div style="" class=""><br style="" class="" clear="none">

<br style="" class="" clear="none">

<div style="" class="">

On 5 June 2014 16:25, Karoline Haus <span style="" class="" dir="ltr"><<a style="" class="" rel="nofollow" shape="rect" ymailto="mailto:karolinehaus@yahoo.de" target="_blank" href="mailto:karolinehaus@yahoo.de">karolinehaus@yahoo.de</a>></span> wrote:<br style="" class="" clear="none"><blockquote class="" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">





<div style="" class=""><div style="" class=""><div class="" style="color:#000;background-color:#fff;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt;"><div style="" class="">Hi I'm trying to create a virtual hard drive using the Python API. <br style="" class="" clear="none">





</div><div class="" style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;"><br style="" class="" clear="none"></div><div class="" style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;">





I can successully create the IMedium object using IVirtualBox::createHardDisk() but then when I try to call createBaseStorage() on that object, I can an error saying "Error in module Medium (VERR_INVALID_PARAMETER)" but I do not get any further details on what the problem is.
 <br style="" class="" clear="none"></div><div class="" style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;"><br style="" class="" clear="none"></div>



<div class="" style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;">

According to the SDK documentation, the only error for this function should be if the medium format is not supported by my system ("The variant of storage creation operation is not supported."), but I am just trying to create a VDI disk, and when I list the HDD backends using VBoxManage, it is definitely supported. The path I'm trying to create the virtual disk under is also accessible and writable.</div>





<div class="" style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;"><br style="" class="" clear="none"></div><div class="" style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;">





What else can the problem be? I do not seem to be able to dig deeper into this. I'm using the <i style="" class="">MediumVariant_Standard</i> variant, so there is nothing special about this either.<br style="" class="" clear="none"></div><div class="" style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;">





<br style="" class="" clear="none"></div><div class="" style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;background-color:transparent;font-style:normal;">Any pointers would be really appreciated.<br style="" class="" clear="none">





</div></div></div></div><br style="" class="" clear="none">_______________________________________________<br style="" class="" clear="none">
vbox-dev mailing list<br style="" class="" clear="none">
<a style="" class="" rel="nofollow" shape="rect" ymailto="mailto:vbox-dev@virtualbox.org" target="_blank" href="mailto:vbox-dev@virtualbox.org">vbox-dev@virtualbox.org</a><br style="" class="" clear="none">
<a style="" class="" rel="nofollow" shape="rect" target="_blank" href="https://www.virtualbox.org/mailman/listinfo/vbox-dev">https://www.virtualbox.org/mailman/listinfo/vbox-dev</a><br style="" class="" clear="none">
<br style="" class="" clear="none"></blockquote></div><br style="" class="" clear="none"></div></div></div><br style="" class="" clear="none"><br style="" class="" clear="none"></div>  </div></div></div> </div>  </div> </div></div></blockquote></div><br style="" class="" clear="none"></div></div></div></div><br style="" class="" clear="none">

<br style="" class="" clear="none"></div>  </div></div></div> </div>  </div> </div></div></blockquote></div><br style="" class="" clear="none"></div></div></div></div><br style="" class=""><br style="" class=""></div>  </div> </div>  </div> </div></body></html>