Get Virtualizor

Manage VPS

Use the Manage VPS API to edit the configuration of the VPS. You can completely fine tune all the settings of the Virtual Private Server like the hostname, root password, storage space, RAM, IP addresses and assigned bandwidth . If you are unsure of any values, you can search for the VPS details by passing the VPS ID to the List Virtual Server API. We recommend using Manage VPS over edit VPS for calibrating the settings of the Virtual Private Servers.

The API response will contain "done" as "true" after successful update of the VPS configurations.

HTTP Request

https://hostname:4085/index.php?act=managevps&vpsid=VPSID

Parameters

NameMethodValueDescriptionRequired
vpsidPOSTIntThe 'VPSID' ID of the vps that needs to be editedYes
uidPOSTIntThe user ID to which the vps belongsNo
user_emailPOSTtextThe email of the user to be addedNo
user_passPOSTtextThe password of the user to be addedNo
fnamePOSTtextThe first name of the user to be addedNo
lnamePOSTtextThe last name of the user to be addedNo
dnsplidPOSTIntThe dns plan ID to be used by the vpsNo
plidPOSTIntIf using plans to configure the vps, then plid has to be specifiedNo
hostnamePOSTtextThe hostname of the vpsNo
rootpassPOSTtextThe password of the vpsNo
ipsPOSTarrayThe ips of type v4 to be used by the vpsNo
ips6POSTarrayThe ips of type v6 to be used by the vpsNo
num_ipsPOSTIntThe number of ips to be assigned and used by the vpsNo
num_ips6POSTnum_ipsThe number of ips to be assigned and used by the vpsNo
spacePOSTarrayThe disk space of the vpsNo
bus_driverPOSTtextProvide bus driver for proxmox QEMU/KVMRequired for Proxmox KVM
bus_driver_numPOSTIntProvide bus driver numbers ranging from 0-5Required for Proxmox KVM
ramPOSTIntThe RAM value to be assigned to the vps in MBNo
swapramPOSTIntThe swap space assigned to the vps to be used a virtual RAM in MBNo
cpuPOSTIntThe CPU weight for the VPSNo
coresPOSTcoresThe number of CPU Cores the vps will useNo
vncPOST1/0If set, VNC access will be enabledNo
vncpassPOSTtextThe password for the vnc consoleNo
acpiPOST1/0If set , then acpi will be enabled for the vpsNo
apicPOST1/0If set , then apic will be enabled for the vpsNo
paePOST1/0If set , then pae will be enabled for the vpsNo
bootPOSTtextThis sets the boot order(cda/dca) of the os inside the vpsNo
disable_ebtablesPOST1/0If set , then disable ebtables for the vpsNo
rdpPOST1/0IF set, then RDP will be enabled for windows vpsNo
admin_managedPOST1/0If set then the VPS cannot be managed from enduser panelNo
disable_nw_configPOST1/0This will disable network config of the vpsNo
cpupinPOSTarrayIF CPU Affinity is not checked then, number of virtual cpus have to be selectedNo
cpu_modePOSTtextRefer Values from below tableNo
topology_socketsPOSTIntSpecify the number of CPU Sockets to be assigned to the VPS (Only for KVM, Proxmox KVM, XCP)No
topology_coresPOSTIntSpecify the number of CPU cores to be assigned to the VPS (Only for KVM, Proxmox KVM, XCP)No
topology_threadsPOSTIntSpecify the number of CPU Threads to be assigned to the VPS (Only for KVM, Proxmox KVM, XCP)No
mgsPOSTarrayThe array of media groups to be assigned to the vpsNo
osreinstall_limitPOSTIntIt sets the OS reinstall limit inside the vpsNo
bandwidthPOSTIntThe bandwidth to be assigned to the vpsNo
network_speedPOSTIntThe network speed to be used by the vps in KB/sNo
upload_speedPOSTIntThis will set the upload speed of the vps in KB/sNo
speed_cap_upPOSTIntUpload speed after the bandwidth is overused for a VPS, 0 or emtpy value indicates no cappingNo
speed_cap_downPOSTIntDownload speed after the bandwidth is overused for a VPS, 0 or emtpy value indicates no capping in KB/sNo
band_suspendPOST1/0If set then the vps will be suspended once it exceeds the bandwidth limit assignedNo
ips_intPOSTarrayThe internal ips to be assigned to the vpsNo
num_ips_int
POSTIntThe number of internal ips to be assigned to the vpsNo
macPOSTtextMac ID to be used by the vps (Only for KVM, Proxmox KVM, Proxmox LXC, LXC, Virtuozzo KVM, XCP and XEN )No
vif_typePOSTtextThe VIF type (netfront or ioemu) (Only for KVM and Xen HVM)No
nic_typePOSTtextThe NIC type (default or e1000) (Only for KVM and Xen)No
dnsPOSTarrayThe array of IPs of dns nameserverNo
virtioPOSTIntPass 0 - none, 1 - virtio, 2 - scsi (Only for KVM)No
kvm_cachePOSTtextThe type disk-cache mechanism can be writeback, writethrough, directsync or default (Only for KVM and Proxmox KVM)No
io_modePOSTtextSets the I/O policy for the VPS can be native/threads (Only for KVM)No
kvm_vgaPOST1/0Enables VGA for the VPS (Only for KVM)No
accelerationPOST1/0If VGA is enabled then this option will enable 2D and 3D acceleration will be for the VPSNo
notesPOSTtextAdds user defined textual noteNo
enable_rescuePOST1/0If set then Rescue will be enabled for the vps (KVM,LXC, Proxmox KVM, Proxmox LXC, xcp and xen)No
rescue_passPOSTtextSet the rescue password when enabledYes (If enable_rescue is set to 1)
conf_rescue_passPOSTtextConfirmation done for the rescue passwordYes (If enable_rescue is set to 1)
disable_rescuePOST1/0If set then Rescue will be disabled for the vps, will work if rescue is enabled (KVM,LXC, Proxmox KVM, Proxmox LXC, xcp and xen)Yes (If you want to disable)
cpu_percentPOSTIntSet the CPU Percent, the vps could use out of the server CPUNo
shadowPOSTIntAmount of Shadow Memory for the vps(Only for Xen)No
isoPOSTtextThe name of the iso file which will be used to install vps (Only for KVM, Proxmox KVM, Virtuozzo KVM, xcp and Xen)No
sec_isoPOSTtextThe name of the secondary iso file which will be used to install vps (Only for KVM, Proxmox KVM, Virtuozzo KVM, xcp and Xen)No
pv_on_hvmPOST1/0If set then it will be enabled for the vps(Only for Xen)No
tuntapPOSTIntFlag to enable tuntap (0 or 1) (Only for OpenVZ/OpenVZ7)No
pppPOSTIntFlag to enable ppp (0 or 1) (Only for OpenVZ/OpenVZ7)No
fusePOSTIntFlag to enable fuse (0 or 1) (Only for OpenVZ/OpenVZ7)No
ipipPOSTIntFlag to enable ipip (0 or 1) (Only for OpenVZ/OpenVZ7)No
ipgrePOSTIntFlag to enable ipgre (0 or 1) (Only for OpenVZ/OpenVZ7)No
nfsPOSTIntFlag to enable nfs (0 or 1) (Only for OpenVZ/OpenVZ7)No
quotaugidlimitPOSTIntProvide quotaugidlimit (Only for OpenVZ/OpenVZ7)No
iolimitPOSTIntProvide iolimit (Only for OpenVZ/OpenVZ7)No
iopslimitPOSTIntProvide iopslimit (Only for OpenVZ/OpenVZ7)No
apply_planPOST1/0This will apply the plan values passed in plidNo
managevdfPOST1/0Haproxy Manage VPS Domain ForwardingNo
hvmPOSTIntPass value if it is hypervisorNo
ioPOSTIntSet I/O value of the vps (Only for OpenVz and Proxmox)No
burstPOSTIntSet the burst RAM for the vps (Only for OpenVz and Proxmox)No
bpidPOSTintProvide backup plan idNo
total_iops_secPOSTIntProvide total I/O per sec in MBs (For KVM only)No
read_bytes_secPOSTIntProvide read mega per sec in MBs (For KVM only)No
write_bytes_secPOSTIntProvide write mega per sec in MBs (For KVM only)No
os_type POST text Setting the proper os_type allows Proxmox VE to optimize some low level parameters, Please refer following table for valid os_type values (For Proxmox kvm only) No
rtc POST1/0 If rtc is is set to1 then it is enabled else it is disabled (For Proxmox kvm only) No
kvm_vgaPOSTIntAssign vga vram value in MB. By default virtualizor will assign 8MB. (For KVM only)No
ssd_emulationPOSTIntProvide 1 for to enable ssd_emulation. (For KVM and Promox kvm only)No
create_infPOST1/0Provide 1 to get the the vps inf content(Serialize data)No
disable_guest_agentPOST1/0Provide 1 to disable guest agent features, Default will be 0.
No


Vertical scaling parameters (Since V3.1.3)

Note
  1. Vertical scaling is supported on KVM based virtualization only.
  2. QEMU version should be greater than or equal to 1.5, To check QEMU Version run "/usr/bin/virsh version"
  3. Vertical scaling is currently not supported on Windows VPS
NameMethod ValueDescriptionRequired
enable_ver_scaling Post 1/0 Pass 1 to enable vertical scaling, If you have already enabled scaling in master settings then no need to pass it No
ver_max_ram Post  int (MB) To set the maximum value for the VM. If provided then it will override the global setting value in master settings.
No
ver_ram_threshold Post int (%) To set the threshold to increase the RAM by value provided. If provided then it will override the global setting value in master settings.
No
ver_ram_inc_by Post int (GB) To increase the RAM after the threshold matches the value. If provided then it will override the global setting value in master settings.
No
ver_max_cpu Post int (Cores) To set the maximum value for the Cores.  If provided then it will override the global setting value in master settings.
No
ver_cpu_threshold
Post int (%) To set the threshold to increase the cores by value provided. If provided then it will override the global setting value in master settings. No
ver_cpu_inc_by
Post int (Core) To increase the Cores after the threshold matches the value. If provided then it will override the global setting value in master settings. No

Valid os_type values (For Proxmox kvm only)

ValuesDescription
otherunspecified OS / Default
wxpMicrosoft Windows XP
w2kMicrosoft Windows 2000
w2k3Microsoft Windows 2003
w2k8Microsoft Windows 2008
wvistaMicrosoft Windows Vista
win7Microsoft Windows 7
win8Microsoft Windows 8/2012/2012r2
win10Microsoft Windows 10/2016
l24Linux 2.4 Kernel
l26Linux 2.6 - 5.X Kernel
solarisSolaris/OpenSolaris/OpenIndiania kernel

CPU Mode values for KVM

( host-model | host-passthrough )

CPU Mode values for Proxmox KVM

( host-model | host-passthrough | 486 | athlon | pentium | pentium2 | pentium3 | coreduo | core2duo | kvm32 | qemu32 | qemu64 | phenom | Conroe | Penryn | Nehalem | SandyBridge | IvyBridge | Haswell | Broadwell | Opteron_G1 | Opteron_G2 | Opteron_G3 | Opteron_G4 | Opteron_G5 )

Bus Drivers For Proxmox KVM

( sata | ide | virtio | scsi )

Sample Code For providing disk space in Proxmox KVM

<?php 
     $post['space'] = array(0=>array(
                            'size' => 2,
                            'st_uuid'=>'ngavdbegidnbme2d',
                            'bus_driver' => 'virtio',
                            'bus_driver_num' => 0),
                        1=>array(
                            'size'=>2,
                            'st_uuid'=>'ngavdbegidnbme2d',
                            'bus_driver' => 'virtio',
                            'bus_driver_num' => 1));
?>

Sample Code

<?php

    require_once('/usr/local/virtualizor/sdk/admin.php');

    $key =  'your_api_key';
    $pass = 'your_api_pass';
    $ip = 'your_server_ip';

    $admin = new Virtualizor_Admin_API($ip, $key, $pass);

    $post['vpsid'] = 51;
    $post['rootpass'] = 'test@123';
    $post['ips'] = array('10.10.100.10');
    $post['hostname'] = 'test123';
    $post['ram'] = 1024;
    $post['bandwidth'] = 0;
    $post['cores'] = 2;
    $post['cpupin'] = 0;
    $post['uid'] = 57;
    $post['network_speed'] = 0;
    $post['upload_speed'] = 0;
    $post['hvm'] = 0;
    $post['io'] = 0;
    $post['burst'] = 0;
    $post['cpu_percent'] = 0;
    $post['acpi'] = 1;
    $post['apic'] = 1;
    $post['pae'] = 1;
    $post['vnc'] = 1;
    $post['shadow'] = 0;
    $post['iso'] = '';
    $post['sec_iso'] = '';
    $post['boot'] = 'cda';
    $post['band_suspend'] = 0;
    $post['tuntap'] = 0;
    $post['pv_on_hvm'] = 0;
    $post['ppp'] = 0;
    $post['mac_status'] = 0;
    $post['osreinstall_limit'] = 0;
    $post['mgs'] = '';
    $post['webuzo'] = '';
    $post['cpu_mode'] = 'default';
    $post['admin_managed'] = 0;
    $post['rdp'] = 1;
    $post['mac'] = '';
    $post['notes'] = '';
    $post['disable_nw_config'] = 0;
    $post['topology_sockets'] = 0;
    $post['topology_cores'] = 0;
    $post['topology_threads'] = 0;
    $post['bpid'] = 24; //Backup plan id
    $post['create_inf'] = 1; //get inf file content

    $output = $admin->managevps($post);

    print_r(json_encode($output));
?>

Output

{
  "title": "Manage VPS",
  "done": {
    "done": true
  },
  "error": [],
  "vs_info": {
    "vpsid": "51",
    "vps_name": "v1009",
    "uuid": "zou88fl1avyklu0s",
    "serid": "0",
    "time": "1535018665",
    "edittime": "1535123989",
    "virt": "kvm",
    "uid": "57",
    "plid": "1",
    "hostname": "test123",
    "osid": "270",
    "os_name": "centos-6.5-x86",
    "iso": "",
    "sec_iso": "",
    "boot": "cda",
    "space": "3",
    "inodes": "0",
    "ram": "1024",
    "burst": "0",
    "swap": "1024",
    "cpu": "1000",
    "cores": "2",
    "cpupin": "-1",
    "cpu_percent": "0.00",
    "bandwidth": "0",
    "network_speed": "0",
    "upload_speed": "0",
    "io": "0",
    "ubc": false,
    "acpi": "1",
    "apic": "1",
    "pae": "1",
    "shadow": "0",
    "vnc": "1",
    "vncport": "5902",
    "vnc_passwd": "",
    "hvm": "0",
    "suspended": "0",
    "suspend_reason": null,
    "nw_suspended": null,
    "rescue": "0",
    "band_suspend": "0",
    "tuntap": "0",
    "ppp": "0",
    "ploop": "0",
    "dns_nameserver": "a:0:{}",
    "osreinstall_limit": "0",
    "preferences": null,
    "nic_type": "virtio",
    "vif_type": "",
    "virtio": "0",
    "pv_on_hvm": "0",
    "disks": [
      {
        "did": "58",
        "disk_uuid": "da3pbqt8qgolohhk",
        "st_uuid": "ngavdbegidnbme2d",
        "vps_uuid": "zou88fl1avyklu0s",
        "path": "/dev/vg/vsv1009-da3pbqt8qgolohhk-zou88fl1avyklu0s",
        "primary": "1",
        "size": "3.000",
        "size_unit": "",
        "type": "block",
        "format": "raw",
        "num": "0",
        "rescue": "0",
        "extra": "",
        "vpsid": "51"
      }
    ],
    "kvm_cache": "0",
    "io_mode": "0",
    "cpu_mode": "default",
    "total_iops_sec": "0",
    "read_bytes_sec": "0",
    "write_bytes_sec": "0",
    "kvm_vga": "0",
    "acceleration": "0",
    "vnc_keymap": "en-us",
    "routing": "0",
    "mg": "",
    "used_bandwidth": "0.17",
    "cached_disk": {
      "disk": {
        "Used": 775340,
        "Available": 1190740,
        "Use%": 39.44
      },
      "inode": {
        "Inodes": 122880,
        "IUsed": 21318,
        "IFree": 101562,
        "Use%": 17.35
      }
    },
    "webuzo": "0",
    "disable_ebtables": "0",
    "install_xentools": "0",
    "admin_managed": "0",
    "rdp": "1",
    "topology_sockets": "0",
    "topology_cores": "0",
    "topology_threads": "0",
    "mac": "",
    "notes": "",
    "disable_nw_config": "0",
    "locked": "",
    "openvz_features": "",
    "speed_cap": "",
    "numa": "0",
    "bpid": "24",
    "bserid": "0",
    "timezone": null,
    "usbdevice": "N;",
    "pid": "0",
    "ips": [
      "10.10.100.10"
    ],
    "ips6": [],
    "ips6_subnet": [],
    "ips_int": []
  }
}
    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list