Add VS ?
Closed this issue · 2 comments
karborator commented
Is it possible to add VS through the wrapper ?
https://docs.onapp.com/display/41API/Add+VS
Deleted user commented
yes, something like:
include 'OnAppInit.php';
$vm = new OnApp_VirtualMachine();
$vm->auth( address, user, password );
$vm->label = 'testvm' . time();
$vm->hostname = 'test.com';
$vm->primary_network_id = 1;
$vm->required_ip_address_assignment = 1;
$vm->memory = 256;
$vm->cpus = 1;
$vm->cpu_shares = 10;
$vm->swap_disk_size = 1;
$vm->required_virtual_machine_build = 1;
$vm->allowed_hot_migrate = false;
$vm->required_automatic_backup = false;
$vm->template_id = 49;
$vm->initial_root_password = 'A' . uniqid();
$vm->primary_disk_size = 5;
$vm->hypervisor_id = 1;
$vm->type_of_format = 'ext4';
$vm->save();
karborator commented
👍