I want to create an application like virt-manager to create and manage virtual machines on ubuntu server using xen hypervisor. so which language is more reliable and simple for doing this. and how can i access xen hypervisor API in my application?
1 Answers
0
votes
If you're talking about XCP/Citrix Xen then in Linux it's better to use C or Python or even bash. All request are made by means of XML RPS and by simple HTTP GET requests via curl/ssh There is an Citrix SDK for this
Creating a VM is pretty simple. All you can do from console via xe is posible. Here is simple code to create vm from template
...
xen_vm_set *vms;
if (!xen_vm_get_by_name_label(xen.session, &vms, template) || vms->size < 1)
{
puts("Template lookup failed.\n");
return (NULL);
}
else
{
printf("Template \"%s\" found\n", template);
}
//Clone VM
xen_vm vm;
xen_vm_clone(xen.session, &vm, vms->contents[0], vm_name);
xen_vm_set_free(vms);
....
Please ask if you need any assistance.