The primary storage could not be found <![CDATA[]]>
I tried to create a php script creating a server with virtualizor api (tested functions and boot/reboot and so on works fine). I need the script to create a vps on the less used node automatically, so I didn't filled the slave_server and stid values (they are not marked as required in the API documentation). Checked the storage which is marked as primary for one of the nodes and it has enough space available (1.8TB). I am able to create VPS from virtualizor panel itself by selecting the node. However when I run the command on the PHP script via API, I get the error: "error":{"no_storage":"The primary storage could not be found"}. If I set the slave_server to a server ID, it works fine, however I need it to automatically select the node. Is this possible?

Here is the script I made:

    $post = array();
    $post['virt'] = 'xen';
    $post['user_email'] = '';
    $post['user_pass'] = 'test123';
    $post['hostname'] = '';
    $post['rootpass'] = 'test123';
    $post['ips'] = array('');
    $post['space'] = '25';
    $post['ram'] = 1024;
    $post['swapram'] = 0;
    $post['bandwidth'] = 0;
    $post['network_speed'] = 0;
    $post['cpu'] = 1000;
    $post['cores'] = 2;
    $post['osid'] = 866;
    $output = $admin->addvs_v2($post);

    return json_encode($output);
Sat, 12 Oct 2019 15:20:55 GMT