title: VDI resizing api does not work
body: <p>I am developing a Xen management webapp with Php. The VDI (virtual disk image) renaming API and resizing APIs usage are very same. I haven't managed to succeed resizing the VDI. Do you think what I am doing wrong here.</p>
  
  <p>Renaming function:</p>
  
  
  
  <pre class="lang-php prettyprint-override"><code>function xenapi_set_vdi_name($session, $ref, $name)
  {
      $conn = $session[0];
      $sess = new xmlrpcval($session[1]);
      $vdi = new xmlrpcval($ref);
      $name = new xmlrpcval($name);
      $msg = new xmlrpcmsg("VDI.set_name_label", array($sess, $vdi, $name));
  
      $res = $conn-&gt;send($msg);
  
      if ($res-&gt;faultcode())
          return false;
      $val = $res-&gt;value();
      $status = $val-&gt;structmem("Status");
      if ($status-&gt;scalarval() != "Success")
          return false;
  
      $value = $val-&gt;structmem("Value");
      return $value-&gt;scalarval();
  }
  </code></pre>
  
  <p>Renaming working usage:</p>
  
  <pre class="lang-php prettyprint-override"><code>...
  xenapi_set_vdi_name($session, $vdi, "NewNameToMyVDI");
  ...
  </code></pre>
  
  <p>Resizing function:</p>
  
  <pre class="lang-php prettyprint-override"><code>function xenapi_set_vdi_virtual_size($session, $ref, $size)
  {
      $conn = $session[0];
      $sess = new xmlrpcval($session[1]);
      $vdi = new xmlrpcval($ref);
      $size = new xmlrpcval($size);
      $msg = new xmlrpcmsg("VDI.set_virtual_size", array($sess, $vdi, $size));
  
      $res = $conn-&gt;send($msg);
  
      if ($res-&gt;faultcode())
          return false;
      $val = $res-&gt;value();
      $status = $val-&gt;structmem("Status");
      if ($status-&gt;scalarval() != "Success")
          return false;
  
      $value = $val-&gt;structmem("Value");
      return $value-&gt;scalarval();
  }
  </code></pre>
  
  <p>Not working resizing usage:</p>
  
  <pre class="lang-php prettyprint-override"><code>...
  $size = '27011707392';
  settype($size, "integer");
  xenapi_set_vdi_virtual_size($session, $vdi, $size);
  ...
  </code></pre>
  
  <p>New size value works with XEN command on physical server as:</p>
  
  <pre class="lang-php prettyprint-override"><code>xe vdi-resize uuid="91fe671c-93e1-4162-8128-96fedc3c215c" disk-size="27011707392"
  </code></pre>