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
Name | Method | Value | Description | Required |
---|---|---|---|---|
vpsid | POST | Int | The 'VPSID' ID of the vps that needs to be edited | Yes |
uid | POST | Int | The user ID to which the vps belongs | No |
user_email | POST | text | The email of the user to be added | No |
user_pass | POST | text | The password of the user to be added | No |
fname | POST | text | The first name of the user to be added | No |
lname | POST | text | The last name of the user to be added | No |
dnsplid | POST | Int | The dns plan ID to be used by the vps | No |
plid | POST | Int | If using plans to configure the vps, then plid has to be specified | No |
hostname | POST | text | The hostname of the vps | No |
rootpass | POST | text | The password of the vps | No |
ips | POST | array | The ips of type v4 to be used by the vps | No |
ips6 | POST | array | The ips of type v6 to be used by the vps | No |
num_ips | POST | Int | The number of ips to be assigned and used by the vps | No |
num_ips6 | POST | num_ips | The number of ips to be assigned and used by the vps | No |
space | POST | array | The disk space of the vps | No |
bus_driver | POST | text | Provide bus driver for proxmox QEMU/KVM | Required for Proxmox KVM |
bus_driver_num | POST | Int | Provide bus driver numbers ranging from 0-5 | Required for Proxmox KVM |
ram | POST | Int | The RAM value to be assigned to the vps in MB | No |
swapram | POST | Int | The swap space assigned to the vps to be used a virtual RAM in MB | No |
cpu | POST | Int | The CPU weight for the VPS | No |
cores | POST | cores | The number of CPU Cores the vps will use | No |
vnc | POST | 1/0 | If set, VNC access will be enabled | No |
vncpass | POST | text | The password for the vnc console | No |
acpi | POST | 1/0 | If set , then acpi will be enabled for the vps | No |
apic | POST | 1/0 | If set , then apic will be enabled for the vps | No |
pae | POST | 1/0 | If set , then pae will be enabled for the vps | No |
boot | POST | text | This sets the boot order(cda/dca) of the os inside the vps | No |
disable_ebtables | POST | 1/0 | If set , then disable ebtables for the vps | No |
rdp | POST | 1/0 | IF set, then RDP will be enabled for windows vps | No |
admin_managed | POST | 1/0 | If set then the VPS cannot be managed from enduser panel | No |
disable_nw_config | POST | 1/0 | This will disable network config of the vps | No |
cpupin | POST | array | IF CPU Affinity is not checked then, number of virtual cpus have to be selected | No |
cpu_mode | POST | text | Refer Values from below table | No |
topology_sockets | POST | Int | Specify the number of CPU Sockets to be assigned to the VPS (Only for KVM, Proxmox KVM, XCP) | No |
topology_cores | POST | Int | Specify the number of CPU cores to be assigned to the VPS (Only for KVM, Proxmox KVM, XCP) | No |
topology_threads | POST | Int | Specify the number of CPU Threads to be assigned to the VPS (Only for KVM, Proxmox KVM, XCP) | No |
mgs | POST | array | The array of media groups to be assigned to the vps | No |
osreinstall_limit | POST | Int | It sets the OS reinstall limit inside the vps | No |
bandwidth | POST | Int | The bandwidth to be assigned to the vps | No |
network_speed | POST | Int | The network speed to be used by the vps in KB/s | No |
upload_speed | POST | Int | This will set the upload speed of the vps in KB/s | No |
speed_cap_up | POST | Int | Upload speed after the bandwidth is overused for a VPS, 0 or emtpy value indicates no capping | No |
speed_cap_down | POST | Int | Download speed after the bandwidth is overused for a VPS, 0 or emtpy value indicates no capping in KB/s | No |
band_suspend | POST | 1/0 | If set then the vps will be suspended once it exceeds the bandwidth limit assigned | No |
ips_int | POST | array | The internal ips to be assigned to the vps | No |
num_ips_int | POST | Int | The number of internal ips to be assigned to the vps | No |
mac | POST | text | Mac ID to be used by the vps (Only for KVM, Proxmox KVM, Proxmox LXC, LXC, Virtuozzo KVM, XCP and XEN ) | No |
vif_type | POST | text | The VIF type (netfront or ioemu) (Only for KVM and Xen HVM) | No |
nic_type | POST | text | The NIC type (default or e1000) (Only for KVM and Xen) | No |
dns | POST | array | The array of IPs of dns nameserver | No |
virtio | POST | Int | Pass 0 - none, 1 - virtio, 2 - scsi (Only for KVM) | No |
kvm_cache | POST | text | The type disk-cache mechanism can be writeback, writethrough, directsync or default (Only for KVM and Proxmox KVM) | No |
io_mode | POST | text | Sets the I/O policy for the VPS can be native/threads (Only for KVM) | No |
kvm_vga | POST | 1/0 | Enables VGA for the VPS (Only for KVM) | No |
acceleration | POST | 1/0 | If VGA is enabled then this option will enable 2D and 3D acceleration will be for the VPS | No |
notes | POST | text | Adds user defined textual note | No |
enable_rescue | POST | 1/0 | If set then Rescue will be enabled for the vps (KVM,LXC, Proxmox KVM, Proxmox LXC, xcp and xen) | No |
rescue_pass | POST | text | Set the rescue password when enabled | Yes (If enable_rescue is set to 1) |
conf_rescue_pass | POST | text | Confirmation done for the rescue password | Yes (If enable_rescue is set to 1) |
disable_rescue | POST | 1/0 | If 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_percent | POST | Int | Set the CPU Percent, the vps could use out of the server CPU | No |
shadow | POST | Int | Amount of Shadow Memory for the vps(Only for Xen) | No |
iso | POST | text | The name of the iso file which will be used to install vps (Only for KVM, Proxmox KVM, Virtuozzo KVM, xcp and Xen) | No |
sec_iso | POST | text | The 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_hvm | POST | 1/0 | If set then it will be enabled for the vps(Only for Xen) | No |
tuntap | POST | Int | Flag to enable tuntap (0 or 1) (Only for OpenVZ/OpenVZ7) | No |
ppp | POST | Int | Flag to enable ppp (0 or 1) (Only for OpenVZ/OpenVZ7) | No |
fuse | POST | Int | Flag to enable fuse (0 or 1) (Only for OpenVZ/OpenVZ7) | No |
ipip | POST | Int | Flag to enable ipip (0 or 1) (Only for OpenVZ/OpenVZ7) | No |
ipgre | POST | Int | Flag to enable ipgre (0 or 1) (Only for OpenVZ/OpenVZ7) | No |
nfs | POST | Int | Flag to enable nfs (0 or 1) (Only for OpenVZ/OpenVZ7) | No |
quotaugidlimit | POST | Int | Provide quotaugidlimit (Only for OpenVZ/OpenVZ7) | No |
iolimit | POST | Int | Provide iolimit (Only for OpenVZ/OpenVZ7) | No |
iopslimit | POST | Int | Provide iopslimit (Only for OpenVZ/OpenVZ7) | No |
apply_plan | POST | 1/0 | This will apply the plan values passed in plid | No |
managevdf | POST | 1/0 | Haproxy Manage VPS Domain Forwarding | No |
hvm | POST | Int | Pass value if it is hypervisor | No |
io | POST | Int | Set I/O value of the vps (Only for OpenVz and Proxmox) | No |
burst | POST | Int | Set the burst RAM for the vps (Only for OpenVz and Proxmox) | No |
bpid | POST | int | Provide backup plan id | No |
total_iops_sec | POST | Int | Provide total I/O per sec in MBs (For KVM only) | No |
read_bytes_sec | POST | Int | Provide read mega per sec in MBs (For KVM only) | No |
write_bytes_sec | POST | Int | Provide 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 | POST | 1/0 | If rtc is is set to1 then it is enabled else it is disabled (For Proxmox kvm only) | No |
kvm_vga | POST | Int | Assign vga vram value in MB. By default virtualizor will assign 8MB. (For KVM only) | No |
ssd_emulation | POST | Int | Provide 1 for to enable ssd_emulation. (For KVM and Promox kvm only) | No |
create_inf | POST | 1/0 | Provide 1 to get the the vps inf content(Serialize data) | No |
disable_guest_agent | POST | 1/0 | Provide 1 to disable guest agent features, Default will be 0. | No |
Note
- Vertical scaling is supported on KVM based virtualization only.
- QEMU version should be greater than or equal to 1.5, To check QEMU Version run "/usr/bin/virsh version"
- Vertical scaling is currently not supported on Windows VPS
Name | Method | Value | Description | Required |
---|---|---|---|---|
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)
Values | Description |
other | unspecified OS / Default |
wxp | Microsoft Windows XP |
w2k | Microsoft Windows 2000 |
w2k3 | Microsoft Windows 2003 |
w2k8 | Microsoft Windows 2008 |
wvista | Microsoft Windows Vista |
win7 | Microsoft Windows 7 |
win8 | Microsoft Windows 8/2012/2012r2 |
win10 | Microsoft Windows 10/2016 |
l24 | Linux 2.4 Kernel |
l26 | Linux 2.6 - 5.X Kernel |
solaris | Solaris/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 ) |
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": []
}
}