api or how to ...

Greetings

I would like to sync our billing system www.WHMCS.com
to autocreate vps'

I am trying to find an api or documentation to make this happen.

WHMCS built one already for hypervm - and that works excellent - but I like the proxmox product much better.

where should one start ?
 
Greetings

I would like to sync our billing system www.WHMCS.com
to autocreate vps'

I am trying to find an api or documentation to make this happen.

WHMCS built one already for hypervm - and that works excellent - but I like the proxmox product much better.

where should one start ?

looks interesting. I do not know whmcs in detail so I need more info how this should work - can you describe the architecture for whmcs/hypervm and pls describe the feature "autocreate vps"?

as we are in early stage we have no out of the box howto for this.
 
whmcs

I think the best place to start would be their website.
I asked them what it would cost to develop this feature - and their first request was - is there an API.

Something like this will take a little bit of planning - however I am sure it could benefit the community for sure.

In short

What I am looking for is to have the ability when someone visits one of our websites they can choose - order a vps.

They can choose the OS / Template - and then
we can create those based upon preset options - such as

20gb 512mb ram / openvz with CentOS 5
or
40gb 1024mb ram / KVM with Windows using an iso

www.Whmcs.com

If it would help - perhaps we could chat over skype briefly - PM me or send a note offline - I dont mind if we can throw a little cash to make this happen.

If it were to - this would make an excellent add on and could help make ProxMox hit the map in a big big way.


Glenn
 
hmmm where to start perhaps

ok - here is a thought - i looked to the wiki - but no luck.

Is there a location where we can find the command line version of everything the gui runs?

If so - we could easily script something from any billing system (like our favorite - www.WHMCS.com that we are trying this with)

in short the billing system could call a local script.
that local script could have an ssh tunnel running to the master node.
the master node could listen to that script say

create vps (type = KVM or OpenVZ) disk size = x ram size = y username = u password = pass and template choice = t and voila - instant ability to create a vps from a billing system.


Ok - so now that I made it sound so easy I am sure there is more involved...

but - thats in short what we would like to do.
 
ok - here is a thought - i looked to the wiki - but no luck.

We are on unix - so please use 'man' ;-)

Code:
man pvectl
man vzctl

Is there a location where we can find the command line version of everything the gui runs?

When you create a VM you can see the executed command on the web interface.

Ok - so now that I made it sound so easy I am sure there is more involved...

not really. For example:
Code:
ssh HOST pvectl vzcreate 777 --ostemplate debian-4.0-standard_4.0-2_i386.tar.gz --disk 8 --mem 512 --swap 512

creates a standard debian vm (pvectl is only a small wrapper around vzctl to make vm creation easier).

Code:
ssh host vzctl set 777 --userpasswd root:XXX --ipadd 192.168.3.103 --save
ssh host vzctl start 777

sets the password and ip, then starts the vm.
...

- Dietmar
 
ok - here is a thought - i looked to the wiki - but no luck.

Is there a location where we can find the command line version of everything the gui runs?

If so - we could easily script something from any billing system (like our favorite - www.WHMCS.com that we are trying this with)

in short the billing system could call a local script.
that local script could have an ssh tunnel running to the master node.
the master node could listen to that script say

create vps (type = KVM or OpenVZ) disk size = x ram size = y username = u password = pass and template choice = t and voila - instant ability to create a vps from a billing system.


Ok - so now that I made it sound so easy I am sure there is more involved...

but - thats in short what we would like to do.

Proxmox VE has currently no user management. So if your customer can create automatically a VM and after this he has no possibility to manage this is more or less useless.

So I suggest you wait till the advanced user management is in place. Then you can think of integrate Proxmox VE into self service portals.
 
Has there been any progress towards an API? I don't really think a user management would be needed, but extending the htm files already there to allow data entry.

For example,

vmlist/create.htm?username=$username
&password=$password
&type=$type
&template=$template
&etc

For example,

api.htm?action=create
&username=$username
&password=$password
&type=$type
&template=$template
&etc

returns xml of the settings (just cluster id, vmid, and ip would do for most applications) or error message.

The parameters can be the input field names, so that a simple view source could find the values needed.

The only thing major I can see is an IP Pool management system. Then you would assign specific ips to a specific server. The API would pull from that pool.
 
...returns xml of the settings (just cluster id, vmid, and ip would do for most applications) or error message.

'pvedaemon' is SOAP server, so there is no need to invent another protocol.

But the SOAP interface is totally undocumented and is subject to change.

- Dietmar
 
YEAH! I was guessing there was something in there, but i guess i can crack open that pvedaemon. Anyone have anything built so far. Don't really want to recreate the wheel.
 
I took a look, but please verify. It should be running on port 83 (I changed the IP to 0.0.0.0 from localhost). What file do we submit the SOAP to? Also, do you have any sample code. Just a launching point!
 
I took a look, but please verify. It should be running on port 83 (I changed the IP to 0.0.0.0 from localhost).

Thats a big security whole! Instead tunnel the port using ssh.

What file do we submit the SOAP to? Also, do you have any sample code. Just a launching point!

I can just show you how to do it with our perl infrastructure. A simple example is:

Code:
#!/usr/bin/perl -w
use strict;
use PVE::ConfigServer;
use Data::Dumper;
 
my $conn = PVE::ConfigClient::connect (); # open connection
 
my $vzlist = $conn->cluster_vzlist()->result; # SOAP call
 
print Dumper ($vzlist); # print result

You can find more examples in the html code (/var/www/pve/vmlist/*.htm)

- Dietmar
 
Last question, hopefully.

I created a seperate /var/www/api folder and configured an apache conf file to not require the user/redirect to the login. Is there a method to authenticate with the same user/pass via either soap or perl.
 
for us it has ...

I got so far as to get a quote - very inexpensive in fact from someone to help do this in our billing system - but they turned us onto a different system that works very well.

We still use ProxMox a great deal - but the openQRM system shows a ton of promise because it supports stand alone servers as well as vps.

Sadly - no openVZ in openQRM.

Great projects - both w/ their own place
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!