RSI attempts to work as a server and responses to requests with system's status including CPU usage, memory usage and virtual machine information via TCP sockets.
RSI server works as daemon process and listens to port 7209(could be changed in rsi.config). After connected to a client, it reads message from client and sends corresponding message in JSON format back to client.
- CMake 2.6+
- libvirt
- libnuma
- tinyxml2(included in this repo)
- jsoncpp(included in this repo)
Input: GET_HOST_MEM_USAGE
Output:
{
"host_mem_total": mem_total,
"host_mem_free": mem_free
}
Input: GET_HOST_CPU_USAGE
Output:
{
"status": "ok"|"error",
"cpu_usage": cpu_usage
}
Input: GET_HOST_NODE_INFO
Output:
{
"node_num": node_num,
"nodes_id": [id0, id1, ...],
"nodes": {
id0: {
"node_mem_total": node_mem_total,
"node_mem_free": node_mem_used
}
}
}
Input: GET_VM_INFO
Output:
[
{
"id": id,
"name": name,
"mem_total": mem_total,
"vcpu": vcpu,
"cpu_usage": cpu_usage,
}
{ ... }
]
Input: GET_VM_INFO vm_id
Output:
{
"status": "ok"|"no such domain",
"id": id,
"mem_total": mem_total_in_KB,
"vcpu": vcpu_num,
"name": name,
"img_path": path_to_image,
"vnc_port": VNC_port
}
Input: OPEN_VM vm_name
Output:
{
"status": "ok"|error_reason,
"vm_id": vm_id if status==ok
}
Input : CLOSE_VM vm_id
Output:
{
"status": "ok"|error_reason
}
{
"status": "cmd not recognized"
}